Image processing device and image processing method

ABSTRACT

Provided is an image processing apparatus including a prediction section that generates a predicted value of a color difference component of a pixel of an image to be decoded by using a function of a value of a corresponding luminance component, a coefficient calculation section that calculates a coefficient of the function used by the prediction section by referencing a pixel around a block to which the pixel belongs, and a controller that controls a ratio of a number of reference pixels used by the coefficient calculation section to a block size of the block.

CROSS REFERENCE TO PRIOR APPLICATION

This application is a National Stage Patent Application of PCTInternational Patent Application No. PCT/JP2012/059168 (filed on Apr. 4,2012) under 35 U.S.C. §371, which claims priority to Japanese PatentApplication Nos. 2011-125473 (filed on Jun. 3, 2011), 2011-145411 (filedon Jun. 30, 2011), and 2011-210542 (filed on Sep. 27, 2011), which areall hereby incorporated by reference in their entirety.

TECHNICAL FIELD

The present disclosure relates to an image processing device, and animage processing method.

BACKGROUND ART

Conventionally, a compression technology is widespread that has itsobject to effectively transmit or accumulate digital images, and thatcompresses the amount of information of an image by motion compensationand orthogonal transform such as discrete cosine transform, for example,by using redundancy unique to the image. For example, an image encodingdevice and an image decoding device conforming to a standard technologysuch as H.26x standards developed by ITU-T or MPEG-y standards developedby MPEG (Moving Picture Experts Group) are widely used in variousscenes, such as accumulation and distribution of images by a broadcasterand reception and accumulation of images by a general user.

The H.26x standards (ITU-T Q6/16 VCEG) are standards developed initiallywith the aim of performing encoding that is suitable for communicationssuch as video telephones and video conferences. The H.26x standards areknown to require a large computation amount for encoding and decoding,but to be capable of realizing a higher compression ratio, compared withthe MPEG-y standards. Furthermore, with Joint Model ofEnhanced-Compression Video Coding, which is a part of the activities ofMPEG4, a standard allowing realization of a higher compression ratio byadopting a new function while being based on the H.26x standards isdeveloped. This standard was made an international standard under thenames of H.264 and MPEG-4 Part10 (Advanced Video Coding; AVC) in March2003.

One important technique in the image encoding method describe above isin-screen prediction, that is, intra prediction. Intra prediction is atechnique of using 6 a correlation between adjacent blocks in an imageand predicting the pixel value of a certain block from the pixel valueof another block that is adjacent to thereby reduce the amount ofinformation to be encoded. With an image encoding method before MPEG4,only the DC component and the low frequency component of an orthogonaltransform coefficient were the targets of intra prediction, but withH.264/AVC, intra prediction is possible for all the pixel values. Byusing intra prediction, a significant increase in the compression ratiocan be expected for an image where the change in the pixel value isgradual, such as an image of the blue sky, for example.

In H.264/AVC, the intra prediction can be made using a block of, forexample, 4×4 pixels, 8×8 pixels, or 16×16 pixels as a processing unit(that is, a prediction unit (PU)). In HEVC (High Efficiency VideoCoding) whose standardization is under way as a next-generation imageencoding scheme subsequent to H.264/AVC, the size of the prediction unitis about to be extended to 32×32 pixels and 64×64 pixels (see Non-PatentLiterature 1).

To make an intra prediction, the optimum prediction mode to predict apixel value of a block to be predicted is normally selected from aplurality of prediction modes. The prediction mode is typicallydistinguished by the prediction direction from a reference pixel to apixel to be predicted. In H.264/AVC, for example, when predicting acolor difference component, four prediction modes of the average valueprediction, horizontal prediction, vertical prediction, and planeprediction can be selected. Further, in HEVC, an additional predictionmode called a linear model (LM) mode that predicts the pixel value of acolor difference component using a linear function of a dynamicallybuilt luminance component as a prediction function is proposed (seeNon-Patent Literature 2).

CITATION LIST

Non-Patent Literature

Non-Patent Literature 1: Sung-Chang Lim, Hahyun Lee, Jinho Lee, JonghoKim, Haechul Choi, Seyoon Jeong, Jin Soo Choi, “Intra coding usingextended block size” (VCEG-AL28, July 2009)

Non-Patent Literature 2: Jianle Chen, et al. “CE6.a.4: Chroma intraprediction by reconstructed luma samples” (JCTVC-E266, March, 2011)

SUMMARY OF INVENTION Technical Problem

According to the technique described in Non-Patent Literature 2described above, however, the processing cost needed to build aprediction function in LM mode increases with an increasing number ofreference pixels. Thus, in HEVC in which the size of the prediction unitis extended up to 64×64 pixels, the increasing processing cost throughthe adoption of the LM mode could degrade performance of encoding anddecoding.

Therefore, when, like the LM mode, the intra prediction based on adynamically built prediction function is made, it is desirable that atechnique capable of avoiding or mitigating an increase in processingcost needed to build a prediction function be provided.

Solution to Problem

According to the present disclosure, there is provided an imageprocessing apparatus including a prediction section that generates apredicted value of a color difference component of a pixel of an imageto be decoded by using a function of a value of a correspondingluminance component, a coefficient calculation section that calculates acoefficient of the function used by the prediction section byreferencing a pixel around a block to which the pixel belongs, and acontroller that controls a ratio of a number of reference pixels used bythe coefficient calculation section to a block size of the block.

The image processing device mentioned above may be typically realized asan image decoding device that decodes an image.

Further, according to an embodiment of the present disclosure, there isprovided an image processing method including generating a predictedvalue of a color difference component of a pixel of an image to bedecoded by using a function of a value of a corresponding luminancecomponent, calculating a coefficient of the function by referencing apixel around a block to which the pixel belongs, and controlling a ratioof a number of reference pixels used for calculating the coefficient toa block size of the block.

Further, according to an embodiment of the present disclosure, there isprovided an image processing apparatus including a prediction sectionthat generates a predicted value of a color difference component of apixel of an image to be encoded by using a function of a value of acorresponding luminance component, a coefficient calculation sectionthat calculates a coefficient of the function used by the predictionsection by referencing a pixel around a block to which the pixelbelongs, and a controller that controls a ratio of a number of referencepixels used by the coefficient calculation section to a block size ofthe block.

The image processing device mentioned above may be typically realized asan image encoding device that encodes an image.

Further, according to an embodiment of the present disclosure, there isprovided an image processing method including generating a predictedvalue of a color difference component of a pixel of an image to beencoded by using a function of a value of a corresponding luminancecomponent, calculating a coefficient of the function by referencing apixel around a block to which the pixel belongs, and controlling a ratioof a number of reference pixels used for calculating the coefficient toa block size of the block.

Further, according to an embodiment of the present disclosure, there isprovided an image processing apparatus including a prediction sectionthat makes an intra prediction of a color difference component of animage using a luminance component of the image to be decoded, and acontroller that variably controls a reference pixel referenced when theintra prediction is made by the prediction section.

The image processing apparatus may be realized as an image encodingdevice that encodes images or as an image decoding device that decodesimages.

Further, according to an embodiment of the present disclosure, there isprovided an image processing method including making an intra predictionof a color difference component of an image using a luminance componentof the image to be decoded, and variably controlling a reference pixelreferenced when the intra prediction of the color difference componentis made.

Advantageous Effects of Invention

According to the technology in the present disclosure, when the intraprediction based on a dynamically built prediction function is made, anincrease in processing cost needed to build a prediction function can beavoided or mitigated.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing an example of a configuration of animage encoding device according to an embodiment.

FIG. 2 is a block diagram showing an example of a detailed configurationof an intra prediction section of the image encoding device of theembodiment.

FIG. 3 is an explanatory view illustrating examples of prediction modecandidates for a luminance component of a prediction unit of 4×4 pixels.

FIG. 4 is an explanatory view illustrating prediction directions relatedto the examples in FIG. 3.

FIG. 5 is an explanatory view illustrating reference pixels related tothe examples in FIG. 3.

FIG. 6 is an explanatory view illustrating examples of prediction modecandidates for a luminance component of a prediction unit of 8×8 pixels.

FIG. 7 is an explanatory view illustrating examples of prediction modecandidates for a luminance component of a prediction unit of 16×16pixels.

FIG. 8 is an explanatory view illustrating examples of prediction modecandidates for a color difference component.

FIG. 9A is a first explanatory view illustrating reference pixels in LMmode.

FIG. 9B is a second explanatory view illustrating reference pixels in LMmode.

FIG. 10 is an explanatory view showing an example of the definition of areference ratio in a first scenario.

FIG. 11A is an explanatory view showing a first example of the number ofreference pixels controlled according to the first scenario.

FIG. 11B is an explanatory view showing a second example of the numberof reference pixels controlled according to the first scenario.

FIG. 12 is an explanatory view showing an example of the definition of areference ratio in a second scenario.

FIG. 13A is an explanatory view showing a first example of the number ofreference pixels controlled according to the second scenario.

FIG. 13B is an explanatory view showing a second example of the numberof reference pixels controlled according to the second scenario.

FIG. 13C is an explanatory view showing a third example of the number ofreference pixels controlled according to the second scenario.

FIG. 13D is an explanatory view showing a fourth example of the numberof reference pixels controlled according to the second scenario.

FIG. 14 is an explanatory view showing an example of the definition of areference ratio in a third scenario.

FIG. 15A is an explanatory view showing a first example of the number ofreference pixels controlled according to the third scenario.

FIG. 15B is an explanatory view showing a second example of the numberof reference pixels controlled according to the third scenario.

FIG. 16 is an explanatory view showing an example of the definition of areference ratio in a fourth scenario.

FIG. 17A is an explanatory view showing a first example of the number ofreference pixels controlled according to the fourth scenario.

FIG. 17B is an explanatory view showing a second example of the numberof reference pixels controlled according to the fourth scenario.

FIG. 18A is an explanatory view showing a first example of the number ofreference pixels controlled according to a fifth scenario.

FIG. 18B is an explanatory view showing a second example of the numberof reference pixels controlled according to the fifth scenario.

FIG. 19 is a flow chart showing an example of the intra predictionprocess at the time of encoding according to the embodiment.

FIG. 20 is a flow chart showing an example of a detailed flow of LM modeprediction processing in FIG. 19.

FIG. 21 is a block diagram showing an example of a detailedconfiguration of the image decoding device according to the embodiment.

FIG. 22 is a block diagram showing an example of the detailedconfiguration of the intra prediction section of the image decodingdevice according to the embodiment.

FIG. 23 is a flow chart showing an example of a flow of an intraprediction process at the time of decoding according to an embodiment.

FIG. 24 is an explanatory view illustrating the size of a memory thatholds a pixel value after the luminance component being resampled.

FIG. 25 is an explanatory view illustrating an example of thinningprocessing according to a first modification.

FIG. 26A is a first explanatory view illustrating a different thinningrate from the example in FIG. 25.

FIG. 26B is a second explanatory view illustrating a different thinningrate from the example in FIG. 25.

FIG. 26C is a third explanatory view illustrating a different thinningrate from the example in FIG. 25.

FIG. 27A is an explanatory view illustrating a first example ofcorrespondence between thinning positions of reference pixels andthinning positions of luminance components.

FIG. 27B is an explanatory view illustrating a second example ofcorrespondence between thinning positions of reference pixels andthinning positions of luminance components.

FIG. 28 is an explanatory view illustrating the order of new processingadopted for a second modification.

FIG. 29 is a block diagram showing an example of a schematicconfiguration of a television.

FIG. 30 is a block diagram showing an example of a schematicconfiguration of a mobile phone.

FIG. 31 is a block diagram showing an example of a schematicconfiguration of a recording/reproduction device.

FIG. 32 is a block diagram showing an example of a schematicconfiguration of an image capturing device.

DESCRIPTION OF EMBODIMENTS

Hereinafter, preferred embodiments of the present invention will bedescribed in detail with reference to the appended drawings. Note that,in this specification and the drawings, elements that have substantiallythe same function and structure are denoted with the same referencesigns, and repeated explanation is omitted.

Furthermore, the “Description of Embodiments” will be described in theorder mentioned below.

1. Example Configuration of Image Encoding Device According to anEmbodiment

2. Flow of Process at the Time of Encoding According to an Embodiment

3. Example Configuration of Image Decoding Device According to anEmbodiment

4. Flow of Process at the Time of Decoding According to an Embodiment

5. Modifications

6. Example Application

7. Summary

<1. Example Configuration of Image Encoding Device According to anEmbodiment>

[1-1. Example of Overall Configuration]

FIG. 1 is a block diagram showing an example of a configuration of animage encoding device 10 according to an embodiment. Referring to FIG.1, the image encoding device 10 includes an A/D (Analogue to Digital)conversion section 11, a sorting buffer 12, a subtraction section 13, anorthogonal transform section 14, a quantization section 15, a losslessencoding section 16, an accumulation buffer 17, a rate control section18, an inverse quantization section 21, an inverse orthogonal transformsection 22, an addition section 23, a deblocking filter 24, a framememory 25, selectors 26 and 27, a motion estimation section 30 and anintra prediction section 40.

The A/D conversion section 11 converts an image signal input in ananalogue format into image data in a digital format, and outputs aseries of digital image data to the sorting buffer 12.

The sorting buffer 12 sorts the images included in the series of imagedata input from the A/D conversion section 11. After sorting the imagesaccording to the a GOP (Group of Pictures) structure according to theencoding process, the sorting buffer 12 outputs the image data which hasbeen sorted to the subtraction section 13, the motion estimation section30 and the intra prediction section 40.

The image data input from the sorting buffer 12 and predicted image datainput by the motion estimation section 30 or the intra predictionsection 40 described later are supplied to the subtraction section 13.The subtraction section 13 calculates predicted error data which is adifference between the image data input from the sorting buffer 12 andthe predicted image data and outputs the calculated predicted error datato the orthogonal transform section 14.

The orthogonal transform section 14 performs orthogonal transform on thepredicted error data input from the subtraction section 13. Theorthogonal transform to be performed by the orthogonal transform section14 may be discrete cosine transform (DCT) or Karhunen-loeve transform,for example. The orthogonal transform section 14 outputs transformcoefficient data acquired by the orthogonal transform process to thequantization section 15.

The transform coefficient data input from the orthogonal transformsection 14 and a rate control signal from the rate control section 18described later are supplied to the quantization section 15. Thequantization section 15 quantizes the transform coefficient data, andoutputs the transform coefficient data which has been quantized(hereinafter, referred to as quantized data) to the lossless encodingsection 16 and the inverse quantization section 21. Also, thequantization section 15 switches a quantization parameter (aquantization scale) based on the rate control signal from the ratecontrol section 18 to thereby change the bit rate of the quantized datato be input to the lossless encoding section 16.

The lossless encoding section 16 generates an encoded stream byperforming lossless encoding processing on quantized data input from thequantization section 15. Lossless encoding by the lossless encodingsection 16 may be, for example, variable-length encoding or arithmeticencoding. Also, the lossless encoding section 16 multiplexes informationon an intra prediction or information on an inter prediction input fromthe selector 27 into a header region of the encoded stream. Then, thelossless encoding section 16 outputs the generated encoded stream to theaccumulation buffer 17.

The accumulation buffer 17 temporarily stores an encoded stream inputfrom the lossless encoding section 16 using a storage medium such as asemiconductor memory. Then, the accumulation buffer 17 outputsaccumulated encoded streams to a transmission section (not shown) (forexample, a communication interface or a connection interface to aperipheral device) at a rate in accordance with the band of thetransmission line.

The rate control section 18 monitors the free space of the accumulationbuffer 17. Then, the rate control section 18 generates a rate controlsignal according to the free space on the accumulation buffer 17, andoutputs the generated rate control signal to the quantization section15. For example, when there is not much free space on the accumulationbuffer 17, the rate control section 18 generates a rate control signalfor lowering the bit rate of the quantized data. Also, for example, whenthe free space on the accumulation buffer 17 is sufficiently large, therate control section 18 generates a rate control signal for increasingthe bit rate of the quantized data.

The inverse quantization section 21 performs an inverse quantizationprocess on the quantized data input from the quantization section 15.Then, the inverse quantization section 21 outputs transform coefficientdata acquired by the inverse quantization process to the inverseorthogonal transform section 22.

The inverse orthogonal transform section 22 performs an inverseorthogonal transform process on the transform coefficient data inputfrom the inverse quantization section 21 to thereby restore thepredicted error data. Then, the inverse orthogonal transform section 22outputs the restored predicted error data to the addition section 23.

The addition section 23 adds the restored predicted error data inputfrom the inverse orthogonal transform section 22 and the predicted imagedata input from the motion estimation section 30 or the intra predictionsection 40 to thereby generate decoded image data. Then, the additionsection 23 outputs the generated decoded image data to the deblockingfilter 24 and the frame memory 25.

The deblocking filter 24 performs a filtering process for reducing blockdistortion occurring at the time of encoding of an image. The deblockingfilter 24 filters the decoded image data input from the addition section23 to remove the block distortion, and outputs the decoded image dataafter filtering to the frame memory 25.

The frame memory 25 stores, using a storage medium, the decoded imagedata input from the addition section 23 and the decoded image data afterfiltering input from the deblocking filter 24.

The selector 26 reads the decoded image data after filtering which is tobe used for inter prediction from the frame memory 25, and supplies thedecoded image data which has been read to the motion estimation section30 as reference image data. Also, the selector 26 reads the decodedimage data before filtering which is to be used for intra predictionfrom the frame memory 25, and supplies the decoded image data which hasbeen read to the intra prediction section 40 as reference image data.

In the inter prediction mode, the selector 27 outputs predicted imagedata which is a result of inter prediction output from the motionestimation section 30 to the subtraction section 13, and also, outputsthe information about inter prediction to the lossless encoding section16. Furthermore, in the intra prediction mode, the selector 27 outputspredicted image data which is a result of intra prediction output fromthe intra prediction section 40 to the subtraction section 13, and also,outputs the information about intra prediction to the lossless encodingsection 16. The selector 27 switches between the inter prediction modeand the intra prediction mode depending on the size of a cost functionoutput from the motion estimation section 30 or the intra predictionsection 40.

The motion estimation section 30 performs inter prediction processing(inter-frame prediction processing) based on image data (original imagedata) to be encoded and input from the reordering buffer 12 and decodedimage data supplied via the selector 26. For example, the motionestimation section 30 evaluates prediction results by each predictionmode using a predetermined cost function. Next, the motion estimationsection 30 selects the prediction mode that produces the minimum costfunction value, that is, the prediction mode that produces the highestcompression ratio as the optimum prediction mode. Also, the motionestimation section 30 generates predicted image data according to theoptimum prediction mode. Then, the motion estimation section 30 outputsprediction mode information indicating the selected optimum predictionmode, information on inter predictions including motion vectorinformation and reference image information, the cost function value,and predicted image data to the selector 27.

The intra prediction section 40 performs intra prediction processing oneach block set inside an image based on original image data input fromthe reordering buffer 12 and decoded image data as reference image datasupplied from the memory frame 25. Then, the intra prediction section 40outputs information on intra predictions, including prediction modeinformation indicating the optimum prediction mode and size relatedinformation, the cost function value, and predicted image data to theselector 27. Prediction modes that can be selected by the intraprediction section 40 include, in addition to existing intra predictionmodes, a linear model (LM) mode about the color difference component. Incontrast to the LM mode described in Non-Patent Literature 2 describedabove, the LM mode in the present embodiment is characterized in thatthe ratio of the number of reference pixels to the block size canchange. The intra prediction processing by the intra prediction section40 will be described later in detail.

[1-2. Configuration Example of Intra Prediction Section]

FIG. 2 is a block diagram showing an example of a detailed configurationof the intra prediction section 40 of an image encoding device 10 shownin FIG. 1. Referring to FIG. 2, the intra prediction section 40 includesa prediction controller 42, a coefficient calculation section 44, aprediction section 46, and a mode determination section 48.

The prediction controller 42 controls intra prediction processing by theintra prediction section 40. For example, the prediction controller 42performs intra prediction processing of the luminance component (Y) andthen performs intra prediction processing of color difference components(Cb, Cr) in coding units (CU). In the intra prediction processing of theluminance component, the prediction controller 42 causes the predictionsection 46 to generate a predicted pixel value of each pixel in aplurality of prediction modes and causes the mode determination section48 to determine the optimum prediction mode of the luminance component.As a result, the arrangement of prediction units in the coding unit isalso decided. In the intra prediction processing of the color differencecomponents, the prediction controller 42 causes the prediction section46 to generate a predicted pixel value of each pixel in a plurality ofprediction modes for each prediction unit and causes the modedetermination section 48 to determine the optimum prediction mode of thecolor difference components.

Prediction mode candidates for the luminance component may be aprediction mode adopted by an existing image encoding scheme such asH.264/AVC or a different prediction mode. Prediction mode candidates forthe color difference component may also contain a prediction modeadopted by an existing image encoding scheme. Further, prediction modecandidates for the color difference component contain theabove-mentioned LM mode. According to the technique described inNon-Patent Literature 2 described above, the ratio of the number ofreference pixels to the block size when coefficients of a predictionfunction in LM mode are calculated is constant. Therefore, the number ofreference pixels increases correspondingly with an increasing blocksize. In the present embodiment, on the other hand, the predictioncontroller 42 controls the above ratio variably. The block size here isin principle a size of the prediction unit. The above-mentioned rationcontrolled by the prediction controller 42, that is, the ratio of thenumber of reference pixels to the block size will herein be called a“reference ratio”. The control of the reference ratio by the predictioncontroller 42 is typically performed in accordance with the block size.Further, the prediction controller 42 may control the reference ratio inaccordance with a chroma-format affecting the block size of the colordifference component corresponding to the prediction unit. Theprediction controller 42 may also control the reference ratio inaccordance with parameters (for example, a profile or level) definingcapabilities of a device for encoding and decoding images. A pluralityof scenarios of controlling the reference ratio by the predictioncontroller 42 will be described later in more detail.

The coefficient calculation section 44 calculates coefficients of aprediction function used by the prediction section 46 in LM mode byreferring to pixels around the prediction unit to which the pixel to bepredicted belongs, that is, reference pixels. The prediction functionused by the prediction section 46 is typically a linear function of thevalue of the luminance component. The number of reference pixelsreferenced by the coefficient calculation section 44 to calculatecoefficients of a prediction function is controlled by, as describedabove, the prediction controller 42.

The prediction section 46 predicts the pixel value of the luminancecomponent and the pixel value of the color difference component of apixel to be predicted according to various prediction mode candidatesunder the control of the prediction controller 42. Examples ofprediction mode candidates used by the prediction section 46 will bedescribed later in more detail. Predicted image data generated as aresult of prediction by the prediction section 46 is output to the modedetermination section 48 for each prediction mode.

The mode determination section 48 calculates the cost function value ofeach prediction mode based on original image data input from thereordering buffer 12 and predicted image data input from the predictionsection 46. Then, based on the calculated cost function value, the modedetermination section 48 decides the optimum prediction mode for theluminance component and the arrangement of prediction units inside thecoding unit. Similarly, based on the cost function value of the colordifference component, the mode determination section 48 decides theoptimum prediction mode for the color difference component. Then, themode determination section 48 outputs information on intra predictionsincluding prediction mode information indicating the decided optimumprediction mode and size related information, the cost function value,and predicted image data including predicted pixel values of theluminance component and the color difference component to the selector27. The size related information output from the mode determinationsection 48 may contain, in addition to information to identify the sizeof each prediction unit, information specifying the chroma-format.

[1-3. Prediction Mode Candidates]

Next, prediction mode candidates that can be used by the predictionsection 46 of the intra prediction section 40 will be described.

(1) Prediction mode candidates for the luminance component

Prediction mode candidates for the luminance component may be aprediction mode adopted by an existing image encoding scheme such asH.264/AVC.

FIGS. 3 to 5 are explanatory views illustrating such prediction modecandidates when the size of the prediction unit is 4×4 pixels.

Referring to FIG. 3, nine prediction modes (Mode 0 to Mode 8) that canbe used for the prediction unit of the 4×4 pixels are shown. In FIG. 4,the prediction direction corresponding to each mode number isschematically shown. In FIG. 5, lower-case alphabetic characters a to prepresent the pixel value of each pixel (that is, each pixel to bepredicted) in the prediction unit of 4×4 pixels. Rz (z=a, b, . . . , m)around the prediction unit represents the pixel value of an encodedreference pixel.

For example, the prediction direction in Mode 0 is a vertical direction,and each predicted pixel value is calculated as below:a=e=i=m=Rab=f=j=n=Rbc=g=k=o=Rcd=h=l=p=Rd

The prediction direction in Mode I is horizontal, and each predictedpixel value is calculated as below:a=b=c=d=Rie=f=g=h=Rji=j=k=1=Rkm=n=o=p=Rl

Mode 2 represents the DC prediction (average value prediction) and eachpredicted pixel value is calculated according to one of the followingfour formulas depending on which reference pixel can be used.a=b= . . . =p=(Ra+Rb+Rc+Rd+Ri+Rj+Rk+Rl+4)>>3a=b= . . . =p—=(Ra+Rb+Rc+Rd+2)>>2a=b= . . . =p=(Ri+Rj+Rk+R+2)>>2a=b= . . . =p=128

The prediction direction in Mode 3 is diagonal down left, and eachpredicted pixel value is calculated as below:a=(Ra+2Rb+Rc+2)>>2b=e=(Rb+2Rc+Rd+2)>>2c=f=i=(Rc+2Rd+Re+2)>>2d=g=j=m=(Rd+2Re+Rf+2)>>2h=k=n=(Re+2Rf+Rg+2)>>2l=o=(Rf+2Rg+Rh+2)>>2p=(Rg+3Rh+2)>>2

The prediction direction in Mode 4 is diagonal down right, and eachpredicted pixel value is calculated as below:m=(Rj+2Rk+Rl+2)>>2i=n=(Ri+2Rj+Rk+2)>>2e=j=o=(Rm+2Ri+Rj+2)>>2a=f=k=p=(Ra+2Rm+Ri+2)>>2b=g=i=(Rm+2Ra+Rb+2)>>2c=h=(Ra+2Rb+Rc+2)>>2d=(Rb+2Rc+Rd+2)>>2

The prediction direction in Mode 5 is vertical right, and each predictedpixel value is calculated as below:a=j=(Rm+Ra+1)>>ib=k=(Ra+Rb+1)>>1c==(Rb+Rc+1)>>1d=(Rc+Rd+1)>>1e=n=(Ri+2Rm+Ra+2)>>2f=o=(Rm+2Ra+Rb+2)>>2g=p=(Ra+2Rb+Rc+2)>>2h=(Rb+2Rc+Rd+2)>>2i=(Rm+2Ri+Rj+2)>>2m=(Ri+2Rj+Rk+2)>>2

The prediction direction in Mode 6 is horizontal down, and eachpredicted pixel value is calculated as below:a=g=(Rm+Ri+1)>>1b=h=(Ri+2Rm+Ra+2)>>2c=(Rm+2Ra+Rb+2)>>2d=(Ra+2Rb+Rc+2)>>2e=k=(Ri+Rj+1)>>1f=1=(Rm+2Ri+Rj+2)>>2i=o=(Rj+Rk+1)>>1j=p=(Ri+2Rj+Rk+2)>>2m=(Rk+Rl+1)>>1n=(Rj+2Rk+Rl+2)>>2

The prediction direction in Mode 7 is vertical left, and each predictedpixel value is calculated as below:a=(Ra+Rb+1)>>1b=i=(Rb+Rc+1)>>1c=j=(Rc+Rd+1)>>1d=k=(Rd+Re+1)>>1l=(Re+Rf+1)>>1e=(Ra+2Rb+Rc+2)>>2f=m=(Rb+2Rc+Rd+2)>>2g=n=(Rc+2Rd+Re+2)>>2h=o=(Rd+2Re+Rf+2)>>2p=(Re+2Rf+Rg+2)>>2

The prediction direction in Mode 8 is horizontal up, and each predictedpixel value is calculated as below:a=(Ri+Rj+1)>>1b=(Ri+2Rj+Rk+2)>>2c=e=(Rj+Rk+1)>>1d=f=(Rj+2Rk+Rl+2)>>2g=i=(Rk+R+1)>>1h=j=(Rk+3Rl+2)>>2k=1=m=n=o=p=Rl

Referring to FIG. 6, nine prediction modes (Mode 0 to Mode 8) that canbe used for the prediction unit of the 8×8 pixels are shown. Theprediction direction in Mode 0 is vertical. The prediction direction inMode 1 is horizontal. Mode 2 represents the DC prediction (average valueprediction). The prediction direction in Mode 3 is DIAGONAL_DOWN_LEFT.The prediction direction in Mode 4 is DIAGONAL_DOWN_RIGHT. Theprediction direction in Mode 5 is VERTICAL_RIGHT. The predictiondirection in Mode 6 is HORIZONTAL_DOWN. The prediction direction in Mode7 is VERTICAL_LEFT. The prediction direction in Mode 8 is HORIZONTAL_UP.

Referring to FIG. 7, four prediction modes (Mode 0 to Mode 3) that canbe used for the prediction unit of the 16×16 pixels are shown. Theprediction direction in Mode 0 is vertical. The prediction direction inMode 1 is horizontal. Mode 2 represents the DC prediction (average valueprediction). Mode 3 represents the plane prediction.

(2) Prediction mode candidates for the color difference component

The prediction mode for the color difference component can be selectedindependently of the prediction mode for the luminance component. InFIG. 8, among prediction mode candidates that can be used when the blocksize of the color difference component is 8×8 pixels, four predictionmodes (Mode 0 to Mode 3) adopted for existing image encoding schemessuch as H.264/AVC are shown.

Mode 0 represents the DC prediction (average value prediction). Here,the predicted pixel value of the pixel position (x, y) is represented asPr_(C)(x, y), eight left reference pixel values are represented asRe_(C)(−1, n), and eight upper reference pixel values are represented asRe_(C)(n, −1). C as a subscript means the color difference component. nis an integer equal to 0 or more and equal to 7 or less. Then, thepredicted pixel value Pr_(C)(x, y) is calculated according to one of thefollowing three formulas depending on which reference pixels areavailable:

[Math  1]${{\Pr_{C}\lbrack {x,y} \rbrack} = ( {{\sum\limits_{n = 0}^{7}\;( {{{Re}_{C}\lbrack {{- 1},n} \rbrack} + {{Re}_{C}\lbrack {n,{- 1}} \rbrack}} )} + 8} )}\operatorname{>>}{4{{\Pr_{C}\lbrack {x,y} \rbrack} = ( {{\sum\limits_{n = 0}^{7}\;{{Re}_{C}\lbrack {{- 1},n} \rbrack}} + 4} )}}\operatorname{>>}{{3{\Pr_{C}\lbrack {x,y} \rbrack}} = ( {{\sum\limits_{n = 0}^{7}\;{{Re}_{C}\lbrack {n,{- 1}} \rbrack}} + 4} )}\operatorname{>>}3$

The prediction direction in Mode I is horizontal, and the predictedpixel value Pr_(C)(x, y) is calculated as below:Pr _(C) [x,y]=Re _(C)[−1,y]  [Math 2]

The prediction direction in Mode 2 is vertical, and the predicted pixelvalue Pr_(C)(x, y) is calculated as below:Pr _(C) [x,y]=Re _(C) [x,−1]  [Math 3]

Mode 3 represents the plane prediction. The predicted pixel valuePr_(C)(x, y) is calculated as below:

[Math  4]${{\Pr_{C}\lbrack {x,y} \rbrack} = {{Clip}\; 1( {a + {b \cdot ( {x - 3} )} + {c \cdot ( {y - 3} )} + 16} )}}\operatorname{>>}{{5a} = {{16 \cdot ( {{{Re}_{C}\lbrack {{- 1},7} \rbrack} + {{Re}_{C}\lbrack {7,{- 1}} \rbrack}} )}{b = ( {{17 \cdot H} + 16} )}}}\operatorname{>>}{5{c = ( {{17 \cdot V} + 16} )}}\operatorname{>>}{{5H} = {{\sum\limits_{x = 1}^{4}\;{{x \cdot ( {{{Re}_{C}\lbrack {{3 + x},{- 1}} \rbrack} - {{Re}_{C}\lbrack {{3 - x},{- 1}} \rbrack}} )}V}} = {\sum\limits_{y = 1}^{4}\;{y \cdot ( {{{Re}_{C}\lbrack {{- 1},{3 + y}} \rbrack} - {{Re}_{C}\lbrack {{- 1},{3 - y}} \rbrack}} )}}}}$

Further, in the present embodiment, the LM mode (as Mode 4, for example)that will be described in the next section can be selected.

[1-4. Details of LM Mode]

In LM mode, the predicted pixel value for the color difference componentis calculated by using a linear function of the value of thecorresponding luminance component. For example, the prediction functionused in LM mode may be the following linear function described inNon-Patent Literature 2:[Math 5]Pr _(C) [x,y]=α·Re _(L) ′[x,y]+β  (1)

In Formula (1), Re_(L)′(x, y) represents the value of the pixel position(x, y) after resampling of the luminance components of a decoded image(so-called reconstructed image). Instead of a decoded image, an originalimage is used for image encoding. The luminance components are resampledwhen the resolution of the color difference component is different fromthe resolution of the luminance component depending on thechroma-format. If, for example, the chroma-format is 4:2:0, theluminance components are resampled according to the following formula insuch a way that the number of pixels is reduced by half in both thehorizontal direction and the vertical direction. Re_(L)(u, v) representsthe value of the luminance component in the pixel position (u, v) beforeresampling.[Math 6]Re _(L) ′[x,y]=(Re _(L)[2x,2y]+Re _(L)[2x,2y+1])>>1  (2)

If the chroma-format is 4:2:2, the luminance components are resampled insuch a way that the number of pixels is reduced by half in thehorizontal direction. If the chroma-format is 4:4:4, the luminancecomponents are not resampled.

The coefficient α in Formula (1) is calculated according to thefollowing formula (3). Also, the coefficient β in Formula (1) iscalculated according to the following formula (4).

[Math  7] $\begin{matrix}{\alpha = \frac{{I \cdot {\sum\limits_{i = 0}^{I}\;{{{Re}_{C}(i)} \cdot {{Re}_{L}^{\prime}(i)}}}} - {\sum\limits_{i = 0}^{I}\;{{{Re}_{C}(i)} \cdot {\sum\limits_{i = 0}^{I}\;{{Re}_{L}^{\prime}(i)}}}}}{{I \cdot {\sum\limits_{i = 0}^{I}\;{{{Re}_{L}^{\prime}(i)} \cdot {{Re}_{L}^{\prime}(i)}}}} - ( {\sum\limits_{i = 0}^{I}\;{{Re}_{L}^{\prime}(i)}} )^{2}}} & (3) \\{\beta = \frac{{\sum\limits_{i = 0}^{I}\;{{Re}_{C}(i)}} - {\alpha \cdot {\sum\limits_{i = 0}^{I}\;{{Re}_{L}^{\prime}(i)}}}}{I}} & (4)\end{matrix}$

In Formulas (3) and (4), I represents the number of reference pixels.If, for example, the block size of the color difference component is 8×8pixels and eight left reference pixels and eight upper reference pixelsare both available, I is calculated as I=8+8=16.

Formulas (1) to (4) described above are the same as formulas describedin Non-Patent Literature 2. FIGS. 9A and 9B are explanatory viewsfurther illustrating reference pixels in the linear model.

In the example of FIG. 9A, the size of the prediction unit (PU) is 16×16pixels and the chroma-format is 4:2:0. In this case, the block size ofthe color difference component is 8×8 pixels. The number of referencepixels Re_(C)(i) of the color difference component is 8+8=16 (if leftand upper reference pixels are both available). The number of referencepixels Re_(L)′(i) of the luminance component is also 8+8=16 as a resultof resampling.

In the example of FIG. 9B, the size of the prediction unit (PU) is 8×8pixels and the chroma-format is 4:2:0. In this case, the block size ofthe color difference component is 4×4 pixels. The number of referencepixels Re_(C)(i) of the color difference component is 4+4=8. The numberof reference pixels Re_(L)′(i) of the luminance component is also 4+4=8as a result of resampling.

Comparison of two examples of FIGS. 9A and 9B shows that the ratio ofthe number of reference pixels to the block size remains unchanged ifother conditions of the chroma-format and the like are the same. Thatis, while the size of one side of the prediction unit in the example ofFIG. 9A is 16 pixels and the number I of reference pixels is 16, thesize of one side of the prediction unit in the example of FIG. 9B iseight pixels and the number I of reference pixels is eight. Thus, if thenumber I of reference pixels increases with an increasing block size,the processing cost needed to calculate the coefficient α and thecoefficient β using Formula (3) and Formula (4) respectively alsoincreases. As will be understood by focusing particularly on Formula(3), the number of times of multiplication of pixel values increases onthe order of the square of the number I of reference pixels. Thus, ifthe number I of reference pixels is not appropriately controlled whencalculating the coefficient α and the coefficient β it is highlyprobable that performance of encoding and decoding is degraded when theblock size is large.

Therefore, as will be described in the next section, the predictioncontroller 42 variably controls the number of reference pixels when thecoefficient calculation section 44 calculates the coefficient α and thecoefficient β of a prediction function in LM mode.

[1-5. Control of the Number of Reference Pixels]

The prediction controller 42 typically controls the reference ratio as aratio of the number of reference pixels to the block size so as todecrease with an increasing block size. An increase in processing costis thereby curbed when the block size increases. When the block size issmall to the extent that the processing cost presents no problem, theprediction controller 42 may not change the reference ratio even if theblock sizes are different. Five exemplary scenarios of control of thereference ratio will be described below with reference to FIGS. 10 to18B.

(1) First Scenario

FIG. 10 is an explanatory view showing an example of the definition ofthe reference ratio in a first scenario.

In the first scenario, the reference ratio is “1:1” if the size of theprediction unit (PU) is 4×4 pixels. The reference ratio “1:1” meansthat, as shown in FIGS. 9A and 9B, reference pixels are all used. Inthis case, if the chroma-format is 4:2:0, the number I of referencepixels is 2(vertical direction I_(v))+2(horizontal direction I_(h))=4.If the chroma-format is 4:2:2, the number 1 of reference pixels is4+2=6. If the chroma-format is 4:4:4, the number I of reference pixelsis 4+4=8.

Similarly, when the size of the prediction unit is 8×8 pixels, thereference ratio is also “1:1”. In this case, if the chroma-format is4:2:0, the number I of reference pixels is 4+4=8. If the chroma-formatis 4:2:2, the number I of reference pixels is 8+4=12. If thechroma-format is 4:4:4, the number I of reference pixels is 8+8=16.

When the size of the prediction unit is 16×16 pixels, by contrast, thereference ratio is “2:1”. The reference ratio “2:1” means that, as shownin FIGS. 9A and 9B, only half the reference pixels are used. That is,the coefficient calculation section 44 thins out half the referencepixels and uses only remaining reference pixels when calculating thecoefficient α and the coefficient β. In this case, if the chroma-formatis 4:2:0, the number I of reference pixels is (8/2)+(8/2)=8. If thechroma-format is 4:2:2, the number I of reference pixels is(16/2)+(8/2)=12. If the chroma-format is 4:4:4, the number I ofreference pixels is (16/2)+(16/2)=16.

FIG. 11A shows an example of reference pixel settings when the PU sizeis 16×16 pixels and the chroma-format is 4:2:0. In the example of FIG.11A, every second reference pixel of the color difference component andevery second reference pixel of the luminance component are thinned out.As a result, the number I_(C) of reference pixels of the colordifference component and the number I_(L) of reference pixels of theluminance component are both eight.

Further, when the size of the prediction unit is 32×32 pixels, thereference ratio is “4:1”. The reference ratio “4:1” means that, as shownin FIGS. 9A and 9B, only one fourth of reference pixels is used. Thatis, the coefficient calculation section 44 thins out three fourths ofreference pixels and uses only remaining reference pixels whencalculating the coefficient α and the coefficient β. In this case, ifthe chroma-format is 4:2:0, the number I of reference pixels is(16/4)+(16/4)=8. If the chroma-format is 4:2:2, the number I ofreference pixels is (32/4)+(16/4)=12. If the chroma-format is 4:4:4, thenumber I of reference pixels is (32/4)+(32/4)=16.

FIG. 11B shows an example of reference pixel settings when the PU sizeis 32×32 pixels and the chroma-format is 4:2:0. In the example of FIG.11B, three reference pixels in every four consecutive pixels of thecolor difference component and three reference pixels in every fourconsecutive pixels of the luminance component are thinned out. As aresult, the number I_(C) of reference pixels of the color differencecomponent and the number I_(L) of reference pixels of the luminancecomponent are both eight.

According to mapping between the block size and reference ratio like inthe first scenario, the number I of reference pixels is constant whenthe block size is 8×8 pixels or more as long as the chroma-format is thesame. Therefore, an increase in processing cost is curbed when the blocksize increases. In addition, by controlling the reference ratio so thatthe number of reference pixels is constant when the block size exceeds apredetermined size, coefficient calculation processing by thecoefficient calculation section 44 can be performed by using a smallcommon circuit or logic. Accordingly, an increase of the circuit scaleor logic scale can also be curbed.

By setting the number of reference pixels to be thinned out to zero whenthe block size falls short of a predetermined size, the degradation ofprediction accuracy in LM mode due to an insufficient number ofreference pixels can be prevented. Particularly when it is comparativelydifficult to make an intra prediction due to complex content of an image(that is, spatial fluctuations of the pixel value are violent), asmaller prediction unit is likely to be set to inside an image. Bysecuring a sufficient number of reference pixels in such a case, thedegradation of prediction accuracy in LM mode can be prevented.

Here, a description is provided that the number of reference pixels tobe thinned out when a coefficient is calculated by the coefficientcalculation section 44 changes in accordance with the reference ratio.That is, the coefficient calculation section 44 has also a role of athinning section that thins out reference pixels referenced when anintra prediction in LM mode is made in the reference ratio in accordancewith the block size to be predicted. This also applies to a coefficientcalculation section 94 of an image decoding device 60 described later.However, instead of thinning out reference pixels, the number ofreference pixels may variably be controlled by deriving onerepresentative value from a plurality of reference pixel values. If, forexample, the reference ratio is “4:1”, an average value of pixels valuesof four consecutive reference pixels or a median value thereof may beused as a representative value. This also applies to other scenariosdescribed herein. While it is quite easy to implement processing to thinout reference pixels, the prediction accuracy can be improved by usingthe above representative value.

(2) Second Scenario

FIG. 12 is an explanatory view showing an example of the definition ofthe reference ratio in a second scenario. In the second scenario, theprediction controller 42 controls the reference ratio in accordance withthe chroma-format, in addition to the size of the prediction unit. Inaddition, the prediction controller 42 separately controls a firstreference ratio as a ratio of the number of left reference pixels to thesize in the vertical direction and a second reference ratio as a ratioof the number of upper reference pixels to the size in the horizontaldirection.

In the second scenario, if the size of the prediction unit is 4×4 pixelsand the chroma-format is 4:2:0, the reference ratio in the verticaldirection and the reference ratio in the horizontal direction are both“1:1”. In this case, no reference pixel is thinned out and the number Iof reference pixels is 2+2=4. If the size of the prediction unit is 4×4pixels and the chroma-format is 4:2:2, the reference ratio in thevertical direction is “2:1” and the reference ratio in the horizontaldirection is “1:1”. In this case, as a result of half the referencepixels of the reference pixels in the vertical direction being thinnedout, the number I of reference pixels is (4/2)+24. If the size of theprediction unit is 4×4 pixels and the chroma-format is 4:4:4, thereference ratio in the vertical direction and the reference ratio in thehorizontal direction are both “2:1”. In this case, as a result of halfthe reference pixels of the reference pixels in both the verticaldirection and the horizontal direction being thinned out, the number Iof reference pixels is (4/2)+(4/2)=4.

If the size of the prediction unit is 8×8 pixels and the chroma-formatis 4:2:0, the reference ratio in the vertical direction and thereference ratio in the horizontal direction are both “1:1”. In thiscase, no reference pixel is thinned out and the number I of referencepixels is 4+4=8. If the size of the prediction unit is 8×8 pixels andthe chroma-format is 4:2:2, the reference ratio in the verticaldirection is “2:1” and the reference ratio in the horizontal directionis “1:1”. In this case, as a result of half the reference pixels of thereference pixels in the vertical direction being thinned out, the numberI of reference pixels is (8/2)+4=8. If the size of the prediction unitis 8×8 pixels and the chroma-format is 4:4:4, the reference ratio in thevertical direction and the reference ratio in the horizontal directionare both “2:1”. In this case, as a result of half the reference pixelsof the reference pixels in both the vertical direction and thehorizontal direction being thinned out, the number I of reference pixelsis (8/2)+(8/2)=8.

FIG. 13A shows an example of reference pixel settings when the PU sizeis 8×8 pixels and the chroma-format is 4:2:0. In the example of FIG.13A, neither reference pixels of the color difference component norreference pixels of the luminance component are thinned out. As aresult, the number I_(C) of reference pixels of the color differencecomponent and the number I_(L) of reference pixels of the luminancecomponent are both eight.

FIG. 13B shows an example of reference pixel settings when the PU sizeis 8×8 pixels and the chroma-format is 4:2:2. In the example of FIG.13B, every second reference pixel in the vertical direction of the colordifference component and the luminance component is thinned out. As aresult, the number I_(C) of reference pixels of the color differencecomponent and the number I_(L) of reference pixels of the luminancecomponent are both eight.

Further, FIG. 13C shows an example of reference pixel settings when thePU size is 8×8 pixels and the chroma-format is 4:4:4. In the example ofFIG. 13C, every second reference pixel in the vertical direction and thehorizontal direction of the color difference component and the luminancecomponent is thinned out. As a result, the number I_(C) of referencepixels of the color difference component and the number I_(L) ofreference pixels of the luminance component are both eight.

If the size of the prediction unit is 16×16 pixels and the chroma-formatis 4:2:0, the reference ratio in the vertical direction and thereference ratio in the horizontal direction are both “2:1”. In thiscase, the number I of reference pixels is (8/2)+(8/2)=8. If the size ofthe prediction unit is 16×16 pixels and the chroma-format is 4:2:2, thereference ratio in the vertical direction is “4:1” and the referenceratio in the horizontal direction is “2:1”. In this case, the number Iof reference pixels is (16/4)+(8/2)=8. If the size of the predictionunit is 16×16 pixels and the chroma-format is 4:4:4, the reference ratioin the vertical direction and the reference ratio in the horizontaldirection are both “4:1”. In this case, the number I of reference pixelsis (16/4)+(16/4)=8.

FIG. 13D shows an example of reference pixel settings when the PU sizeis 16×16 pixels and the chroma-format is 4:2:0. In the example of FIG.13D, every second reference pixel in the vertical direction and thehorizontal direction of the color difference component and the luminancecomponent is thinned out. As a result, the number I_(C) of referencepixels of the color difference component and the number I_(L) ofreference pixels of the luminance component are both eight.

If the size of the prediction unit is 32×32 pixels and the chroma-formatis 4:2:0, the reference ratio in the vertical direction and thereference ratio in the horizontal direction are both “4:1”. In thiscase, the number I of reference pixels is (16/4)+(16/4)=8. If the sizeof the prediction unit is 32×32 pixels and the chroma-format is 4:2:2,the reference ratio in the vertical direction is “8:1” and the referenceratio in the horizontal direction is “4:1”. In this case, the number Iof reference pixels is (32/8)+(6/4)=8. If the size of the predictionunit is 32×32 pixels and the chroma-format is 4:4:4, the reference ratioin the vertical direction and the reference ratio in the horizontaldirection are both “8:1”. In this case, the number I of reference pixelsis (32/8)+(32/8)=8.

In the second scenario, as will be understood from the abovedescription, the prediction controller 42 controls the reference ratioso that the reference ratio decreases with an increasing resolution ofthe color difference component represented by the chroma-format. Anincrease in processing cost accompanying an increasing block size of thecolor difference component is thereby curbed. Also in the secondscenario, if the chroma-format is 4:2:2, the prediction controller 42separately controls the reference ratio in the vertical direction andthe reference ratio in the horizontal direction so that the number ofreference pixels on the left of the block and the number of referencepixels above the block become equal. Accordingly, the numbers ofreference pixels can be made the same in a plurality of cases in whichchroma-formats are mutually different. As a result, coefficientcalculation processing by the coefficient calculation section 44 can beperformed by using a common circuit or logic regardless of thechroma-format. Therefore, according to the second scenario, efficientimplementation of a circuit or logic is promoted.

(3) Third Scenario

FIG. 14 is an explanatory view showing an example of the definition ofthe reference ratio in a third scenario. Also in the third scenario, theprediction controller 42 separately controls the first reference ratioas a ratio of the number of left reference pixels to the size in thevertical direction and the second reference ratio as a ratio of thenumber of upper reference pixels to the size in the horizontaldirection. In the third scenario, the prediction controller 42 controlsthe reference ratios so that the reference ratio in the verticaldirection is equal to the reference ratio in the horizontal direction orless to the same size.

In the third scenario, the reference ratios in the vertical directionand the horizontal direction are both “1:1” if the size of theprediction unit is 4×4 pixels. In this case, if the chroma-format is4:2:0, the number I of reference pixels is 2+2=4. If the chroma-formatis 4:2:2, the number I of reference pixels is 4+2=6. If thechroma-format is 4:4:4, the number I of reference pixels is 4+4=8.

If the size of the prediction unit is 8×8 pixels, the reference ratio inthe vertical direction is “2:1” and the reference ratio in thehorizontal direction is “1:1”. In this case, if the chroma-format is4:2:0, the number I of reference pixels is (4/2)+4=6. If thechroma-format is 4:2:2, the number I of reference pixels is (8/2)+4=8.If the chroma-format is 4:4:4, the number I of reference pixels is(8/2)+8=12.

FIG. 15A shows an example of reference pixel settings when the PU sizeis 8×8 pixels and the chroma-format is 4:2:0. In the example of FIG.15A, lower half the reference pixels in the vertical direction ofreference pixels of the color difference component and reference pixelsof the luminance component are thinned out. As a result, the numberI_(C) of reference pixels of the color difference component and thenumber I_(L) of reference pixels of the luminance component are bothsix.

If the size of the prediction unit is 16×16 pixels, the reference ratioin the vertical direction is “4:1” and the reference ratio in thehorizontal direction is “1:1”. In this case, if the chroma-format is4:2:0, the number I of reference pixels is (8/4)+8=10. If thechroma-format is 4:2:2, the number I of reference pixels is (16/4)+8=12.If the chroma-format is 4:4:4, the number I of reference pixels is(16/4)+16-20.

FIG. 15B shows an example of reference pixel settings when the PU sizeis 16×16 pixels and the chroma-format is 4:2:0. In the example of FIG.15B, three fourths of the lower half reference pixels in the verticaldirection of reference pixels of the color difference component andreference pixels of the luminance component are thinned out. As aresult, the number I_(C) of reference pixels of the color differencecomponent and the number I_(L) of reference pixels of the luminancecomponent are both 10.

If the size of the prediction unit is 32×32 pixels, the reference ratioin the vertical direction is “8:1” and the reference ratio in thehorizontal direction is “2:1”.

In this case, if the chroma-format is 4:2:0, the number I of referencepixels is (16/8)+(16/2)=10. If the chroma-format is 4:2:2, the number Iof reference pixels is (32/8)+(16/2)=12. If the chroma-format is 4:4:4,the number I of reference pixels is (32/8)+(32/2)=20.

In a device that encodes or decodes images, the reference pixel value isstored in a frame memory or line memory in most cases and accessed inunits of line in the horizontal direction. Therefore, if the referenceratio in the vertical direction is made smaller than the reference ratioin the horizontal direction like in the third scenario, the number oftimes of accessing a memory can be reduced even if the number ofreference pixels to be used is the same. Accordingly, coefficientcalculation processing by the coefficient calculation section 44 can beperformed at high speed. In addition, by using reference pixels in anupper line of the block preferentially like in the third scenario, thereference pixel value can be acquired in a short time through continuousaccess to the memory.

(4) Fourth Scenario

FIG. 16 is an explanatory view showing an example of the definition ofthe reference ratio in a fourth scenario. In the fourth scenario, theprediction controller 42 controls the reference ratio so that thereference ratio decreases with decreasing capabilities of a device thatencodes and decodes images. In HEVC, for example, the profile, thelevel, or both can be used as parameters representing capabilities of adevice. The profile and the level can normally be specified in asequence parameter set of an encoded stream.

Referring to FIG. 16, in the fourth scenario, capabilities of a deviceare classified into two categories of “high” and “low”. Regarding theprediction unit having the size of 4×4 pixels, the reference ratio is“1:1” regardless of capabilities of a device. Regarding the predictionunit having the size of 8×8 pixels or more, by contrast, the referenceratio when capabilities are “low” is half the reference ratio whencapabilities are “high”.

For example, while the reference ratio when capabilities are “high” is“1:1” for the prediction unit of 8×8 pixels, the reference ratio whencapabilities are “low” is “2:1”. Regarding the prediction unit havingthe size of 16×16 pixels, while the reference ratio when capabilitiesare “high” is “2:1”, the reference ratio when capabilities are “low” is“4:1”. Regarding the prediction unit having the size of 32×32 pixels,while the reference ratio when capabilities are “high” is “4:1”, thereference ratio when capabilities are “low” is “8:1”.

FIG. 17A shows an example of reference pixel settings when the PU sizeis 16×16 pixels, the chroma-format is 4:2:0, capabilities are “high”,and the reference ratio is “2:1”. In the example of FIG. 17A, half thereference pixels of reference pixels of the color difference componentand reference pixels of the luminance component are thinned out. As aresult, the number I_(C) of reference pixels of the color differencecomponent and the number I_(L) of reference pixels of the luminancecomponent are both eight.

FIG. 17B shows an example of reference pixel settings when the PU sizeis 16×16 pixels, the chroma-format is 4:2:0, capabilities are “low”, andthe reference ratio is “4:1”. In the example of FIG. 17B, three fourthsof the lower half reference pixels of reference pixels of the colordifference component and reference pixels of the luminance component arethinned out. As a result, the number I_(c) of reference pixels of thecolor difference component and the number I_(L) of reference pixels ofthe luminance component are both four.

By controlling the reference ratio in accordance with the level ofcapabilities of a device (for example, the processing capacity of adecoder) like in the fourth scenario, the number of reference pixels canfurther be reduced when the use of a device of lower capabilities isassumed. Accordingly, the processing cost exceeding the processingcapacity of a device can be prevented from arising in coefficientcalculation processing in LM mode.

(5) Fifth Scenario

Xiaoran Cao Tsinghua et al. propose in “CE6.b1 Report on Short DistanceIntra Prediction Method” (JCTVC-E278, March 2011) the short distanceintra prediction method that improves encoding efficiency by using asmall-sized non-square prediction unit. In the short distance intraprediction method, for example, prediction units of various sizes suchas 1×4 pixels, 2×8 pixels, 4×16 pixels, 4×1 pixels, 8×2 pixels, and 16×4pixels can be set into an image. In this case, which of the size in thevertical direction and the size in the horizontal direction of theprediction unit is larger depends on settings of the prediction unit.Thus, in the fifth scenario, when the short distance intra predictionmethod is used, the prediction controller 42 dynamically selects thereference ratio corresponding to the direction to which larger of thereference ratio in the vertical direction and the reference ratio in thehorizontal ratio corresponds and controls the selected reference ratio.

FIG. 18A shows an example of reference pixel settings when the PU sizeis 2×8 pixels and the chroma-format is 4:2:0. In the example of FIG.18A, the size in the horizontal direction is larger than the size in thevertical direction and thus, while the reference ratio in the verticaldirection is “1:1”, the reference ratio in the horizontal direction is“2:1”. As a result, the number I_(C) of reference pixels of the colordifference component and the number I_(L) of reference pixels of theluminance component are both 1+(4/2)=3.

FIG. 18B shows an example of reference pixel settings when the PU sizeis 16×4 pixels and the chroma-format is 4:2:0. In the example of FIG.18B, the size in the vertical direction is larger than the size in thehorizontal direction and thus, while the reference ratio in thehorizontal direction is “1:1”, the reference ratio in the verticaldirection is “4:1”. As a result, the number I_(C) of reference pixels ofthe color difference component and the number I_(L) of reference pixelsof the luminance component are both (8/4)+2=4.

When, like in the fifth scenario, the short distance intra predictionmethod is used, by dynamically selecting and controlling the referenceratio corresponding to the direction in which the size is larger, thedegradation in prediction accuracy can be prevented by avoiding thereduction of the number of reference pixels in the direction in whichthe number thereof is smaller.

Heretofore, five characteristic scenarios of control of the referenceration by the prediction controller 42 have been described in detail.The control of the reference ratio by the prediction controller 42according to these scenarios may be performed by mapping, for example,between the block size pre-defined in standard specifications of animage encoding scheme and the reference ratio. By uniformly definingsuch mapping in advance, the need to support setting patterns of manyreference pixels is eliminated so that a circuit or logic for decodingcan easily be made common.

While the bit depth of image data utilized for many uses is 8 bits, agreater bit depth such as 10 bits or 12 bits may be used for image datafor some uses. Thus, if the bit depth exceeds a predetermined number ofbits (for example, 8 bits), the coefficient calculation section 44 mayreduce the reference pixel value to the predetermined number of bitsbefore calculating the coefficient at and the coefficient β of aprediction function using the reduced reference pixel value.Accordingly, the coefficient α and the coefficient β can be calculatedusing a small-sized common circuit or logic regardless of the bit depth.

An example in which the prediction controller 42 controls the “referenceratio” as a ratio of the number of reference pixels to the block size ismainly described here. However, the concept substantially equivalent tothe reference ratio may be expressed by another term, for example, a“reduction ratio” meaning the ratio of reference pixels to be reduced.The “reference ratio” or “reduction ratio” may be expressed by, insteadof the above format such as “1:1”, “2:1”, and “4:1”, the percentageformat like “100%(0%)”, “50% (50%)”, or “25% (75%)” or the numeric 26format in the range from 0 to 1.

The above five scenarios are only examples for description. For example,two scenarios or more of the above five scenarios may be combined.Mapping between the block size and the reference ratio (or the reductionratio) as shown in each scenario may be, instead of defined in advance,adaptively selected. In this case, information specifying the selectedmapping may be transmitted from the encoding side to the decoding sideinside the parameter set or the header area of an encoded stream.

<2. Flow of Processing at the Time of Encoding According to anEmbodiment>

Next, the flow of processing at the time of encoding will be describedusing FIGS. 19 and 20. FIG. 19 is a flow chart showing an example of theflow of intra prediction processing at the time of encoding by the intraprediction section 40 having the configuration as illustrated in FIG. 2.

Referring to FIG. 19, predicted image data in various prediction modesis first generated by the prediction section 46 for the luminancecomponent of the coding unit to be processed and the optimum predictionmode and the arrangement of prediction units are decided by the modedetermination section 48 (step S100).

Next, prediction processing in LM mode is performed for the colordifference component by the coefficient calculation section 44 and theprediction section 46 (step S110). In addition, intra predictionprocessing in non-LM mode (for example, Mode 0 to Mode 3 illustrated inFIG. 8) is performed for the color difference component by thecoefficient calculation section 44 and the prediction section 46 (stepS120). The processing in step S110 and step S120 can be performed foreach prediction unit under the control of the prediction controller 42.

Next, the mode determination section 48 calculates the cost functionvalue based on original image data and predicted image data for each ofthe prediction modes of the color difference component (step S130).Then, the mode determination section 48 decides the optimum predictionmode by comparing the cost function values (step S140).

FIG. 20 is a flow chart showing an example of a detailed flow of LM modeprediction processing in step S110 of FIG. 19. Referring to FIG. 20, theprediction controller 42 first acquires the reference ratio for eachprediction unit in accordance with the size of the prediction unit andother parameters (for example, the chroma-format, profile, or level)(step S111).

Next, the coefficient calculation section 44 sets reference pixels to bereferenced by the calculation formula (for example, the above Formula(3) and Formula (4)) to calculate coefficients of a prediction functionaccording to the reference ratio instructed by the prediction controller42 (step S112). The number of reference pixels set here can be reducedin accordance with the reference ratio. In addition, the luminancecomponents of reference pixels can be resampled depending on thechroma-format.

Next, the coefficient calculation section 44 calculates the coefficientα of a prediction function using pixel values of set reference pixelsaccording to, for example, the above Formula (3) (step S113). Further,the coefficient calculation section 44 calculates the coefficient β of aprediction function using pixel values of set reference pixels accordingto, for example, the above Formula (4) (step S114).

Then, the prediction section 46 calculates the predicted pixel value ofeach pixel to be predicted by substituting the value of thecorresponding luminance component into a prediction function (forexample, the above Formula (1)) built by using the coefficient α and thecoefficient β (step S115).

<3. Example Configuration of Image Decoding Device According to anEmbodiment>

In this section, an example configuration of an image decoding deviceaccording to an embodiment will be described using FIGS. 21 and 22.

[3-1. Example of Overall Configuration]

FIG. 21 is a block diagram showing an example of a configuration of animage decoding device 60 according to an embodiment. Referring to FIG.21, the image decoding device 60 includes an accumulation buffer 61, alossless decoding section 62, an inverse quantization section 63, aninverse orthogonal transform section 64, an addition section 65, adeblocking filter 66, a sorting buffer 67, a D/A (Digital to Analogue)conversion section 68, a frame memory 69, selectors 70 and 71, a motioncompensation section 80 and an intra prediction section 90.

The accumulation buffer 61 temporarily stores an encoded stream inputvia a transmission line using a storage medium.

The lossless decoding section 62 decodes an encoded stream input fromthe accumulation buffer 61 according to the encoding method used at thetime of encoding. Also, the lossless decoding section 62 decodesinformation multiplexed to the header region of the encoded stream.Information that is multiplexed to the header region of the encodedstream may include the profile and the level in a sequence parameterset, and the information about inter prediction and information aboutintra prediction in the block header, for example. The lossless decodingsection 62 outputs the information about inter prediction to the motioncompensation section 80. Also, the lossless decoding section 62 outputsthe information about intra prediction to the intra prediction section90.

The inverse quantization section 63 inversely quantizes quantized datawhich has been decoded by the lossless decoding section 62. The inverseorthogonal transform section 64 generates predicted error data byperforming inverse orthogonal transformation on transform coefficientdata input from the inverse quantization section 63 according to theorthogonal transformation method used at the time of encoding. Then, theinverse orthogonal transform section 64 outputs the generated predictederror data to the addition section 65.

The addition section 65 adds the predicted error data input from theinverse orthogonal transform section 64 and predicted image data inputfrom the selector 71 to thereby generate decoded image data. Then, theaddition section 65 outputs the generated decoded image data to thedeblocking filter 66 and the frame memory 69.

The deblocking filter 66 removes block distortion by filtering thedecoded image data input from the addition section 65, and outputs thedecoded image data after filtering to the sorting buffer 67 and theframe memory 69.

The sorting buffer 67 generates a series of image data in a timesequence by sorting images input from the deblocking filter 66. Then,the sorting buffer 67 outputs the generated image data to the D/Aconversion section 68.

The D/A conversion section 68 converts the image data in a digitalformat input from the sorting buffer 67 into an image signal in ananalogue format. Then, the D/A conversion section 68 causes an image tobe displayed by outputting the analogue image signal to a display (notshown) connected to the image decoding device 60, for example.

The frame memory 69 stores, using a storage medium, the decoded imagedata before filtering input from the addition section 65, and thedecoded image data after filtering input from the deblocking filter 66.

The selector 70 switches the output destination of the image data fromthe frame memory 70 between the motion compensation section 80 and theintra prediction section 90 for each block in the image according tomode information acquired by the lossless decoding section 62. Forexample, in the case the inter prediction mode is specified, theselector 70 outputs the decoded image data after filtering that issupplied from the frame memory 70 to the motion compensation section 80as the reference image data. Also, in the case the intra prediction modeis specified, the selector 70 outputs the decoded image data beforefiltering that is supplied from the frame memory 70 to the intraprediction section 90 as reference image data.

The selector 71 switches the output source of predicted image data to besupplied to the addition section 65 between the motion compensationsection 80 and the intra prediction section 90 according to the modeinformation acquired by the lossless decoding section 62. For example,in the case the inter prediction mode is specified, the selector 71supplies to the addition section 65 the predicted image data output fromthe motion compensation section 80. Also, in the case the intraprediction mode is specified, the selector 71 supplies to the additionsection 65 the predicted image data output from the intra predictionsection 90.

The motion compensation section 80 performs a motion compensationprocess based on the information about inter prediction input from thelossless decoding section 62 and the reference image data from the framememory 69, and generates predicted image data. Then, the motioncompensation section 80 outputs the generated predicted image data tothe selector 71.

The intra prediction section 90 performs an intra prediction processbased on the information about intra prediction input from the losslessdecoding section 62 and the reference image data from the frame memory69, and generates predicted image data. Then, the intra predictionsection 90 outputs the generated predicted image data to the selector71. The intra prediction process of the intra prediction section 90 willbe described later in detail.

[3-2. Configuration Example of Intra Prediction Section]

FIG. 22 is a block diagram showing an example of a detailedconfiguration of an intra prediction section 90 of the image decodingdevice 60 shown in FIG. 21. Referring to FIG. 22, the intra predictionsection 90 includes a prediction controller 92, a coefficientcalculation section 94, and a prediction section 96.

The prediction controller 92 controls intra prediction processing by theintra prediction section 90. For example, the prediction controller 92sets one prediction unit or more to each coding unit based on predictionmode information contained in information on an intra prediction. Theprediction controller 92 performs intra prediction processing of theluminance component (Y) and then performs intra prediction processing ofcolor difference components (Cb, Cr). In the intra prediction processingof the luminance component, the prediction controller 92 causes theprediction section 96 to generate a predicted pixel value of theluminance component of each pixel in prediction mode specified byprediction mode information. Similarly, in the intra predictionprocessing of the luminance component, the prediction controller 92causes the prediction section 96 to generate a predicted pixel value ofthe color difference component of each pixel in prediction modespecified by prediction mode information.

In the present embodiment, prediction mode candidates for the colordifference component contain the above-mentioned LM mode. Then, theprediction controller 92 variably controls the ratio of the number ofreference pixels when coefficients of a prediction function in LM modeis calculated to the block size, that is, the reference ratio. Thecontrol of the reference ratio by the prediction controller 92 istypically performed in accordance with the block size. If, for example,the block size exceeds a predetermined size, the prediction controller92 may control the reference ratio so that the number of referencepixels for calculating coefficients of a prediction function becomesconstant. Mapping between the block size and reference ratio may bedefined in advance and stored in a storage medium of the image decodingdevice 60 or may dynamically be specified inside the header area of anencoded stream. Further, the prediction controller 92 may control thereference ratio in accordance with the chroma-format. Also, theprediction controller 92 may control the reference ratio in accordancewith the profile or level defining capabilities of a device. The controlof the reference ratio by the prediction controller 92 may be performedaccording to one of the above five scenarios, any combination thereof,or other scenarios.

The coefficient calculation section 94 calculates coefficients of aprediction function used by the prediction section 96 when the LM modeis specified for the color difference component by referring to pixelsaround the prediction unit to which the pixel to be predicted belongs,that is, reference pixels. The prediction function used by theprediction section 96 is typically a linear function of the value of theluminance component and is represented by, for example, the aboveFormula (1). The number of reference pixels referenced by thecoefficient calculation section 94 to calculate coefficients of aprediction function is controlled by, as described above, the predictioncontroller 92. If the reference ratio is not “1:1”, the coefficientcalculation section 94 may calculate coefficients of a predictionfunction by, for example, thinning out as many reference pixels as anumber in accordance with the reference ratio and then using onlyremaining reference pixels. The coefficient calculation section 94 maycalculate coefficients of a prediction function using a common circuitor logic for a plurality of block sizes exceeding a predetermined size.In addition, if the bit depth of a pixel value exceeds a predeterminednumber of bits, the coefficient calculation section 94 may reduce thereference pixel value to the predetermined number of bits beforecalculating coefficients of a prediction function using the reducedreference pixel value.

The prediction section 96 generates the pixel value of the luminancecomponent and the pixel value of the color difference component of thepixel to be predicted according to the specified prediction mode usingreference image data from a frame memory 69 under the control of theprediction controller 92. Prediction mode candidates used for the colordifference component by the prediction section 96 may contain the aboveLM mode. When the LM mode is specified, the prediction section 96calculates the predicted pixel value of the color difference componentby substituting the value (resampled if necessary) of the correspondingluminance component into a prediction function built by using thecoefficient α and the coefficient 3 calculated by the coefficientcalculation section 94. The prediction section 96 outputs predictedimage data generated as a result of prediction to an addition section 65via a selector 71.

<4. Flow of Processing at the Time of Decoding According to anEmbodiment>

Next, the flow of processing at the time of decoding will be describedusing FIG. 23. FIG. 23 is a flow chart showing an example of the flow ofintra prediction processing at the time of decoding by the intraprediction section 90 having the configuration as illustrated in FIG.22.

Referring to FIG. 23, the prediction controller 92 first sets oneprediction unit or more to each coding unit (step S200). Then,processing in steps S210 to S260 can be performed on each predictionunit under the control of the prediction controller 42.

Next, the prediction controller 92 recognizes the prediction mode of theluminance component specified by the prediction mode information (stepS210). Then, the prediction section 96 generates the predicted pixelvalue of the luminance component of each pixel in the prediction unitaccording to the specified prediction mode using reference image datafrom the frame memory 69 (step S220).

Next, the prediction controller 92 recognizes the prediction mode of thecolor difference component specified by the prediction mode information(step S230). Then, the prediction controller 92 determines whether theLM mode is specified (step S240). If the LM mode is specified, theprediction controller 92 causes the coefficient calculation section 94and the prediction section 96 to perform prediction processing of thecolor difference component in LM mode (step S250). The LM modeprediction processing in step S250 may be similar to the LM modeprediction processing described using FIG. 20. On the other hand, if theLM mode is not specified, the prediction controller 92 causes theprediction section 96 to perform intra prediction processing of thecolor difference component in non-LM mode (step S260).

<5. Modifications>

In the above embodiment, the prediction section 46 of the intraprediction section 40 of the image encoding device 10 calculates thepredicted pixel value of the color difference component in LM modeaccording to the above Formula (1). Similarly, the prediction section 96of the intra prediction section 90 of the image decoding device 60calculates the predicted pixel value of the color difference componentin LM mode according to the above Formula (1). Re_(L)′(x, y) on theright-hand side of Formula (1) represents the value of the pixelposition (x, y) of the luminance component of a decoded image afterresampling. Thus, when the calculation of the predicted pixel value isdone in blocks, the pixel value of the luminance component afterresampling in blocks is held until the predicted pixel value of thecolor difference component is calculated.

For example, LCU₁ shown on the left of FIG. 24 is divided into 10 codingunits CU₀ to CU₉. As an example, the size of LCU₁ is 128×128 pixels, thesize of the coding units CU₀ and CU₅ is 64×64 pixels, and the size ofthe coding units CU₁ to CU₄ and CU₆ to CU₉ is 32×32 pixels. Thecalculation of the predicted pixel value is normally done for eachcoding unit and thus, if the chroma-format is 4:2:0 in this case, amemory of 32×32 pixels (particularly for the coding units CU₀ and CU₅)may be provided to hold pixel values of the luminance components afterresampling. On the other hand, the size of LCU₂ shown on the right ofFIG. 24 is 128×128 pixels and only one CU₁₀ is contained inside LCU₂. Ifthe chroma-format is 4:2:0 in this case, a memory of 64×64 pixels may beprovided to hold pixel values of the luminance components afterresampling. The amount of consumption of memory resources increases withan increasing bit depth of a pixel.

The above increase of the amount of consumption of memory resources isnot desirable for a device whose memory resources are limited. Thus, inthis section, two modifications to reduce the amount of consumption ofmemory resources in connection with the introduction of the LM mode willbe described.

[5-1. First Modification]

In a first modification, the prediction section 46 of the image encodingdevice 10 and the prediction section 96 of the image decoding device 60thin out luminance components corresponding to each color differencecomponent at some thinning rate. The luminance component correspondingto each color difference component corresponds to each luminancecomponent after resampling according to, for example, the above Formula(2). Then, the prediction section 46 and the prediction section 96generate the predicted values of each color difference componentcorresponding to thinned luminance components by using values ofluminance components that are not thinned out.

FIG. 25 is an explanatory view illustrating an example of thinningprocessing according to the present modification. Referring to FIG. 25,the prediction unit (PU) of 8×8 pixels is shown as an example. It isassumed that the chroma-format 4:2:0 and the thinning rate is 25%. Thethinning rate indicates the ratio of the number of pixels after thinningto the number of pixels before thinning. In the example of FIG. 25, thenumber of color difference components contained in one PU is 4×4. Thenumber of luminance components corresponding to each color differencecomponent is also 4×4 due to resampling. As a result of thinningluminance components after resampling at the thinning rate 25%, thenumber of luminance components used to predict the color differencecomponent in LM mode is 2×2. More specifically, in the example at thelower right of FIG. 25, among four luminance components Lu1 to Lu4, theluminance components Lu2, Lu3, Lu4 other than the luminance componentLu1 are thinned out. Similarly, among four luminance components Lu5 toLu8, the luminance components Lu6, Lu7, Lu8 other than the luminancecomponent Lu5 are thinned out. The color difference component Cu1 at thelower left of FIG. 25 corresponds to the luminance component Lu1 that isnot thinned out. Therefore, the prediction section 46 and the predictionsection 96 can generate the predicted values of the color differencecomponent Cu1 by substituting the value of the luminance component Lu1into the right-hand side of the above Formula (1). On the other hand,for example, the color difference component Cu2 corresponds to thethinned luminance component Lu2. In this case, the prediction section 46and the prediction section 96 generate the predicted values of the colordifference component Cu2 using the value of any luminance component thatis not thinned out. For example, the predicted value of the colordifference component Cu2 may be replication of the predicted value ofthe color difference component Cu1 or a value obtained by linearinterpolation of two predicted values of the color difference componentsCu1, Cu5.

More generally, for example, the predicted pixel value Pr_(C)(x, y) ofthe color difference component when the thinning rate is 25% may becalculated by techniques represented by the following Formula (5) orFormula (6). Formula (5) represents replication of a predicted valuefrom adjacent pixels.

[Math  8] $\begin{matrix}{{\Pr_{C}\lbrack {x,y} \rbrack} = \{ \begin{matrix}{{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {x,y} \rbrack}} + \beta} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{0\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 0}} ) \\{\Pr_{C}\lbrack {{x - 1},y} \rbrack} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{1\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 0}} ) \\{\Pr_{C}\lbrack {x,{y - 1}} \rbrack} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{0\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 1}} ) \\{\Pr_{C}\lbrack {{x - 1},{y - 1}} \rbrack} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{1\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 1}} )\end{matrix} } & (5)\end{matrix}$

Formula (6) represents linear interpolation of a predicted value.

[Math  9] $\begin{matrix}{{{Pt}_{C}\lbrack {x,y} \rbrack} = \{ \begin{matrix}{{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {x,y} \rbrack}} + \beta} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{0\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 0}} ) \\\frac{( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {{x - 1},y} \rbrack}} + \beta} ) + ( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {{x + 1},y} \rbrack}} + \beta} )}{2} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{1\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 0}} ) \\\frac{( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {x,{y - 1}} \rbrack}} + \beta} ) + ( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {x,{y + 1}} \rbrack}} + \beta} )}{2} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{0\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 1}} ) \\\frac{( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {{x - 1},{y - 1}} \rbrack}} + \beta} ) + ( {{\alpha \cdot {{Re}_{L}^{\prime}\lbrack {{x + 1},{y + 1}} \rbrack}} + \beta} )}{2} & ( {{x\mspace{14mu}{mod}\mspace{14mu} 2} = {{1\&\&{y\mspace{14mu}{mod}\mspace{14mu} 2}} = 1}} )\end{matrix} } & (6)\end{matrix}$

Incidentally, Formula (5) and Formula (6) are only examples and otherformulas may also be used.

The above thinning rate affects the amount of memory resources to holdpixel values after resampling of the luminance components. The amount ofconsumption of memory resources decreases with an increasing number ofluminance components to be thinned out. However, if the number ofluminance components to be thinned out is large, the accuracy ofprediction of the color difference component may be degraded. Thus, theparameter to specify the thinning rate may be specified in the header(for example, the sequence parameter set, picture parameter set, orslice header) of an encoded stream. In this case, the prediction section96 of the image decoding device 60 decides the thinning rate based onthe parameter acquired from the header. Accordingly, the thinning ratecan flexibly be changed in accordance with requirements (for example,which of saving of memory resources and encoding efficiency should havehigher priority) for each device.

Referring to FIGS. 26A to 26C, in contrast to the example in FIG. 25,the thinning rate is 50% in each case. In these examples, half theluminance components of luminance components after resampling arethinned out. However, even if the thinning rate is the same, patterns ofposition of luminance components to be thinned out (hereinafter, calledthinning patterns) are mutually different.

In the example of FIG. 26A, among four luminance components Lu1 to Lu4,the luminance components Lu2, Lu4 are thinned out. Similarly, among fourluminance components Lu5 to Lu8, the luminance components Lu6, Lu8 arethinned out. Also in this case, for example, the predicted value of thecolor difference component Cu2 corresponding to the thinned luminancecomponent Lu2 may be replication of the predicted value of the colordifference component Cu1 or a value obtained by linear interpolation oftwo predicted values of the color difference components Cu1, Cu5. In thethinning pattern of FIG. 26A, luminance components to be thinned out areuniformly distributed in the PU. Therefore, compared with other thinningpatterns of the same thinning rate, the thinning pattern in FIG. 26Arealizes higher prediction accuracy.

In the example of FIG. 26B, luminance components are thinned out inevery other row. Such a thinning pattern is advantageous in that, forexample, in a device holding pixel values in a line memory, values ofmany luminance components can be accessed by memory access at a time. Inthe example of FIG. 26C, on the other hand, luminance components arethinned out in every other column. Such a thinning pattern isadvantageous in that, for example, if the chroma-format is 4:2:2 and thenumber of pixels in the vertical direction is larger, more frequencycomponents in the column direction can be maintained.

The parameter to specify the thinning pattern from a plurality ofthinning pattern candidates may be specified in the header of an encodedstream. In this case, the prediction section 96 of the image decodingdevice 60 decides the positions of luminance components to be thinnedout based on the parameter acquired from the header. Accordingly, thethinning pattern can flexibly be changed in accordance with requirementsfor each device.

In addition, the prediction section 46 and the prediction section 96 maydecide the thinning rates in accordance with the above reference ratio.If, for example, the number of reference pixels referenced whencoefficients of a prediction 26 function are calculated is smaller, moreluminance components may be thinned out. At this point, the predictionsection 46 and the prediction section 96 may thin out luminancecomponents in positions corresponding to thinning positions of referencepixels.

FIGS. 27A and 27B each show examples of correspondence between thinningpositions of reference pixels and thinning positions of luminancecomponents. In the example of FIG. 27A, the PU size is 16×16 pixels, thechroma-format is 4:2:0, and the reference ratio is 2:1. In this case,for example, the thinning rate is decided in favor of 25% and thinningpatterns similar to examples in FIG. 25 may be selected. In the exampleof FIG. 27B, on the other hand, the PU size is 16×16 pixels, thechroma-format is 4:2:0, the reference ratio in the vertical direction is2:1, and the reference ratio in the horizontal direction is 1:1. In thiscase, for example, the thinning rate is decided in favor of 50% andthinning patterns similar to the example in FIG. 26B may be selected.

In the example of FIG. 27A, all luminance components of the block to bepredicted are thinned out in rows in which the reference pixel isthinned out. All luminance components of the block to be predicted arethinned out in columns in which the reference pixel is thinned out. Bydeciding thinning positions in this manner, the determination ofthinning positions is simplified and the implementation of thinningprocessing according to the present modification can be made stilleasier. Also in the example of FIG. 27B, all luminance components of theblock to be predicted are thinned out in rows in which the referencepixel is thinned out. By deciding thinning positions in this manner,access to luminance components can completely be skipped in rowscorresponding to the thinning positions regardless of reference pixelsor pixels to be predicted. Accordingly, the implementation of thinningprocessing is made still easier and also the processing speed can beincreased by reducing the number of times of memory access.

[5-2. Second Modification]

In a second modification, the order of new processing by the intraprediction section 40 of the image encoding device 10 and the intraprediction section 90 of the image decoding device 60 are adopted.

FIG. 28 is an explanatory view illustrating the order of new processingadopted for the present modification. Referring to FIG. 28, as anexample, LCU including coding units CU₀, CU₁, CU₂ and other coding unitsis shown. Further, the coding unit CU₀ is divided into four predictionunits PU₀₀, PU₀₁, PU₀₂, and PU₀₃. The coding unit CU₁ is divided intofour prediction units PU₁₀, PU₁₁, PU₁₂, and PU₁₃. The coding unit CU₂ isdivided into four prediction units PU₂₀, PU₂₁, PU₂₂, and PU₂₃. Accordingto the existing technique, intra prediction processing for the LCU isperformed likeY₀₀→Y₀₁→Y₀₂→Y₀₃→Cb₀₀→Cb₀₁→Cb₀₂→Cb₀₃→Cr₀₀→Cr₀₁→Cr₀₂→Cr₀₃→Y₁₀→ . . .Y_(NN) represents an intra prediction of the luminance component of theprediction unit PU_(NN) and Cb_(NN) and Cr_(NN) each represent an intraprediction of a color difference component of the prediction unitPU_(NN). That is, according to the existing technique, intra predictionprocessing is performed for each component in each coding unit. Such anorder of processing is here called an “order by component”. In thepresent modification, on the other hand, for example, the predictioncontroller 42 of the intra prediction section 40 of the image encodingdevice 10 and the prediction controller 92 of the intra predictionsection 90 of the image decoding device 60 control processing of each ofsections so that intra prediction processing is performed for eachprediction unit in each coding unit. Such an order of new processing iscalled an “order by PU”. When, for example, the order by PU is appliedto LCU in FIG. 28, intra prediction processing of the luminancecomponent Y₀₀ and the two color difference components Cb₀₀, Cr₀₀ of theprediction unit PU₀₀ is first performed. Next, intra predictionprocessing of the luminance component Y₀₁ and the two color differencecomponents Cb₀₁, Cr₀₁ of the prediction unit PU₀₁ is performed. Then,intra prediction processing of three components is repeated in the orderof the prediction units PU₀₂, PU₀₃, PU₁₀, . . .

In the order by component according to the existing technique, theamount of memory resources to hold luminance component values referencedfor intra prediction in LM mode is affected by the size of the maximumcoding unit. If, for example, the size of the maximum coding unit is128×128 pixels, the chroma-format is 4:2:0, and the bit depth is 10bits, memory resources of 64×64×10 bits are needed. In the order by PUdescribed above, on the other hand, the amount of memory resources tohold luminance component values referenced for intra prediction in LMmode is affected by the size of the maximum prediction unit. If, forexample, the coding unit is divided into four prediction units or more,the amount of memory resources needed for the case of the order by PU isone fourth the amount of memory resources needed for the case of theorder by component. Therefore, by adopting the above order by PU, theamount of consumption of memory resources can be reduced.

<6. Example Application>

The image encoding device 10 and the image decoding device 60 accordingto the embodiment described above may be applied to various electronicappliances such as a transmitter and a receiver for satellitebroadcasting, cable broadcasting such as cable TV, distribution on theInternet, distribution to terminals via cellular communication, and thelike, a recording device that records images in a medium such as anoptical disc, a magnetic disk or a flash memory, a reproduction devicethat reproduces images from such storage medium, and the like. Fourexample applications will be described below.

[6-1. First Example Application]

FIG. 29 is a block diagram showing an example of a schematicconfiguration of a television adopting the embodiment described above. Atelevision 900 includes an antenna 901, a tuner 902, a demultiplexer903, a decoder 904, an video signal processing section 905, a displaysection 906, an audio signal processing section 907, a speaker 908, anexternal interface 909, a control section 910, a user interface 911, anda bus 912.

The tuner 902 extracts a signal of a desired channel from broadcastsignals received via the antenna 901, and demodulates the extractedsignal. Then, the tuner 902 outputs an encoded bit stream obtained bydemodulation to the demultiplexer 903. That is, the tuner 902 serves astransmission means of the televisions 900 for receiving an encodedstream in which an image is encoded.

The demultiplexer 903 separates a video stream and an audio stream of aprogram to be viewed from the encoded bit stream, and outputs eachstream which has been separated to the decoder 904. Also, thedemultiplexer 903 extracts auxiliary data such as an EPG (ElectronicProgram Guide) from the encoded bit stream, and supplies the extracteddata to the control section 910. Additionally, the demultiplexer 903 mayperform descrambling in the case the encoded bit stream is scrambled.

The decoder 904 decodes the video stream and the audio stream input fromthe demultiplexer 903. Then, the decoder 904 outputs video datagenerated by the decoding process to the video signal processing section905. Also, the decoder 904 outputs the audio data generated by thedecoding process to the audio signal processing section 907.

The video signal processing section 905 reproduces the video data inputfrom the decoder 904, and causes the display section 906 to display thevideo. The video signal processing section 905 may also cause thedisplay section 906 to display an application screen supplied via anetwork. Further, the video signal processing section 905 may perform anadditional process such as noise removal, for example, on the video dataaccording to the setting. Furthermore, the video signal processingsection 905 may generate an image of a GUI (Graphical User Interface)such as a menu, a button, a cursor or the like, for example, andsuperimpose the generated image on an output image.

The display section 906 is driven by a drive signal supplied by thevideo signal processing section 905, and displays a video or an image onan video screen of a display device (for example, a liquid crystaldisplay, a plasma display, an OLED, or the like).

The audio signal processing section 907 performs reproduction processessuch as D/A conversion and amplification on the audio data input fromthe decoder 904, and outputs audio from the speaker 908. Also, the audiosignal processing section 907 may perform an additional process such asnoise removal on the audio data.

The external interface 909 is an interface for connecting the television900 and an external appliance or a network. For example, a video streamor an audio stream received via the external interface 909 may bedecoded by the decoder 904. That is, the external interface 909 alsoserves as transmission means of the televisions 900 for receiving anencoded stream in which an image is encoded.

The control section 910 includes a processor such as a CPU (CentralProcessing Unit), and a memory such as an RAM (Random Access Memory), anROM (Read Only Memory), or the like. The memory stores a program to beexecuted by the CPU, program data, EPG data, data acquired via anetwork, and the like. The program stored in the memory is read andexecuted by the CPU at the time of activation of the television 900, forexample. The CPU controls the operation of the television 900 accordingto an operation signal input from the user interface 911, for example,by executing the program.

The user interface 911 is connected to the control section 910. The userinterface 911 includes a button and a switch used by a user to operatethe television 900, and a receiving section for a remote control signal,for example. The user interface 911 detects an operation of a user viathese structural elements, generates an operation signal, and outputsthe generated operation signal to the control section 910.

The bus 912 interconnects the tuner 902, the demultiplexer 903, thedecoder 904, the video signal processing section 905, the audio signalprocessing section 907, the external interface 909, and the controlsection 910.

In the television 900 configured as described above, the decoder 904 hasa function of the image decoding device 60 according to the embodimentdescribed above. Accordingly, an increase in processing costaccompanying the extension of block size can be curbed even when the LMmode is adopted for decoding images of the television 900.

[6-2. Second Example Application]

FIG. 30 is a block diagram showing an example of a schematicconfiguration of a mobile phone adopting the embodiment described above.A mobile phone 920 includes an antenna 921, a communication section 922,an audio codec 923, a speaker 924, a microphone 925, a camera section926, an image processing section 927, a demultiplexing section 928, arecording/reproduction section 929, a display section 930, a controlsection 931, an operation section 932, and a bus 933.

The antenna 921 is connected to the communication section 922. Thespeaker 924 and the microphone 925 are connected to the audio codec 923.The operation section 932 is connected to the control section 931. Thebus 933 interconnects the communication section 922, the audio codec923, the camera section 926, the image processing section 927, thedemultiplexing section 928, the recording/reproduction section 929, thedisplay section 930, and the control section 931.

The mobile phone 920 performs operation such as transmission/receptionof audio signal, transmission/reception of emails or image data, imagecapturing, recording of data, and the like, in various operation modesincluding an audio communication mode, a data communication mode, animage capturing mode, and a videophone mode.

In the audio communication mode, an analogue audio signal generated bythe microphone 925 is supplied to the audio codec 923. The audio codec923 converts the analogue audio signal into audio data, and A/D convertsand compresses the converted audio data. Then, the audio codec 923outputs the compressed audio data to the communication section 922. Thecommunication section 922 encodes and modulates the audio data, andgenerates a transmission signal. Then, the communication section 922transmits the generated transmission signal to a base station (notshown) via the antenna 921. Also, the communication section 922amplifies a wireless signal received via the antenna 921 and convertsthe frequency of the wireless signal, and acquires a received signal.Then, the communication section 922 demodulates and decodes the receivedsignal and generates audio data, and outputs the generated audio data tothe audio codec 923. The audio codec 923 extends and D/A converts theaudio data, and generates an analogue audio signal. Then, the audiocodec 923 supplies the generated audio signal to the speaker 924 andcauses the audio to be output.

Also, in the data communication mode, the control section 931 generatestext data that makes up an email, according to an operation of a uservia the operation section 932, for example. Moreover, the controlsection 931 causes the text to be displayed on the display section 930.Furthermore, the control section 931 generates email data according to atransmission instruction of the user via the operation section 932, andoutputs the generated email data to the communication section 922. Then,the communication section 922 encodes and modulates the email data, andgenerates a transmission signal. Then, the communication section 922transmits the generated transmission signal to a base station (notshown) via the antenna 921. Also, the communication section 922amplifies a wireless signal received via the antenna 921 and convertsthe frequency of the wireless signal, and acquires a received signal.Then, the communication section 922 demodulates and decodes the receivedsignal, restores the email data, and outputs the restored email data tothe control section 931. The control section 931 causes the displaysection 930 to display the contents of the email, and also, causes theemail data to be stored in the storage medium of therecording/reproduction section 929.

The recording/reproduction section 929 includes an arbitrary readableand writable storage medium. For example, the storage medium may be abuilt-in storage medium such as an RAM, a flash memory or the like, oran externally mounted storage medium such as a hard disk, a magneticdisk, a magneto-optical disk, an optical disc, an USB memory, a memorycard, or the like.

Furthermore, in the image capturing mode, the camera section 926captures an image of a subject, generates image data, and outputs thegenerated image data to the image processing section 927, for example.The image processing section 927 encodes the image data input from thecamera section 926, and causes the encoded stream to be stored in thestorage medium of the recording/reproduction section 929.

Furthermore, in the videophone mode, the demultiplexing section 928multiplexes a video stream encoded by the image processing section 927and an audio stream input from the audio codec 923, and outputs themultiplexed stream to the communication section 922, for example. Thecommunication section 922 encodes and modulates the stream, andgenerates a transmission signal. Then, the communication section 922transmits the generated transmission signal to a base station (notshown) via the antenna 921. Also, the communication section 922amplifies a wireless signal received via the antenna 921 and convertsthe frequency of the wireless signal, and acquires a received signal.These transmission signal and received signal may include an encoded bitstream. Then, the communication section 922 demodulates and decodes thereceived signal, restores the stream, and outputs the restored stream tothe demultiplexing section 928. The demultiplexing section 928 separatesa video stream and an audio stream from the input stream, and outputsthe video stream to the image processing section 927 and the audiostream to the audio codec 923. The image processing section 927 decodesthe video stream, and generates video data. The video data is suppliedto the display section 930, and a series of images is displayed by thedisplay section 930. The audio codec 923 extends and D/A converts theaudio stream, and generates an analogue audio signal. Then, the audiocodec 923 supplies the generated audio signal to the speaker 924 andcauses the audio to be output.

In the mobile phone 920 configured in this manner, the image processingsection 927 has a function of the image encoding device 10 and the imagedecoding device 60 according to the embodiment described above.Accordingly, an increase in processing cost accompanying the extensionof block size can be curbed even when the LM mode is adopted forencoding and decoding images of the mobile phone 920.

[6-3. Third Example Application]

FIG. 31 is a block diagram showing an example of a schematicconfiguration of a recording/reproduction device adopting the embodimentdescribed above. A recording/reproduction device 940 encodes, andrecords in a recording medium, audio data and video data of a receivedbroadcast program, for example. The recording/reproduction device 940may also encode, and record in the recording medium, audio data andvideo data acquired from another device, for example. Furthermore, therecording/reproduction device 940 reproduces, using a monitor or aspeaker, data recorded in the recording medium, according to aninstruction of a user, for example. At this time, therecording/reproduction device 940 decodes the audio data and the videodata.

The recording/reproduction device 940 includes a tuner 941, an externalinterface 942, an encoder 943, an HDD (Hard Disk Drive) 944, a discdrive 945, a selector 946, a decoder 947, an OSD (On-Screen Display)948, a control section 949, and a user interface 950.

The tuner 941 extracts a signal of a desired channel from broadcastsignals received via an antenna (not shown), and demodulates theextracted signal. Then, the tuner 941 outputs an encoded bit streamobtained by demodulation to the selector 946. That is, the tuner 941serves as transmission means of the recording/reproduction device 940.

The external interface 942 is an interface for connecting therecording/reproduction device 940 and an external appliance or anetwork. For example, the external interface 942 may be an IEEE 1394interface, a network interface, an USB interface, a flash memoryinterface, or the like. For example, video data and audio data receivedby the external interface 942 are input to the encoder 943. That is, theexternal interface 942 serves as transmission means of therecording/reproduction device 940.

In the case the video data and the audio data input from the externalinterface 942 are not encoded, the encoder 943 encodes the video dataand the audio data. Then, the encoder 943 outputs the encoded bit streamto the selector 946.

The HDD 944 records in an internal hard disk an encoded bit stream,which is compressed content data of a video or audio, various programs,and other pieces of data. Also, the HDD 944 reads these pieces of datafrom the hard disk at the time of reproducing a video or audio.

The disc drive 945 records or reads data in a recording medium that ismounted. A recording medium that is mounted on the disc drive 945 may bea DVD disc (a DVD-Video, a DVD-RAM, a DVD-R, a DVD-RW, a DVD+, a DVD+RW,or the like), a Blu-ray (registered trademark) disc, or the like, forexample.

The selector 946 selects, at the time of recording a video or audio, anencoded bit stream input from the tuner 941 or the encoder 943, andoutputs the selected encoded bit stream to the HDD 944 or the disc drive945. Also, the selector 946 outputs, at the time of reproducing a videoor audio, an encoded bit stream input from the HDD 944 or the disc drive945 to the decoder 947.

The decoder 947 decodes the encoded bit stream, and generates video dataand audio data. Then, the decoder 947 outputs the generated video datato the OSD 948. Also, the decoder 904 outputs the generated audio datato an external speaker.

The OSD 948 reproduces the video data input from the decoder 947, anddisplays a video. Also, the OSD 948 may superimpose an image of a GUI,such as a menu, a button, a cursor or the like, for example, on adisplayed video.

The control section 949 includes a processor such as a CPU, and a memorysuch as an RAM or an ROM. The memory stores a program to be executed bythe CPU, program data, and the like. A program stored in the memory isread and executed by the CPU at the time of activation of therecording/reproduction device 940, for example. The CPU controls theoperation of the recording/reproduction device 940 according to anoperation signal input from the user interface 950, for example, byexecuting the program.

The user interface 950 is connected to the control section 949. The userinterface 950 includes a button and a switch used by a user to operatethe recording/reproduction device 940, and a receiving section for aremote control signal, for example. The user interface 950 detects anoperation of a user via these structural elements, generates anoperation signal, and outputs the generated operation signal to thecontrol section 949.

In the recording/reproduction device 940 configured in this manner, theencoder 943 has a function of the image encoding device 10 according tothe embodiment described above. Also, the decoder 947 has a function ofthe image decoding device 60 according to the embodiment describedabove. Accordingly, an increase in processing cost accompanying theextension of block size can be curbed even when the LM mode is adoptedfor encoding and decoding images of the recording/reproduction device940.

[6-4. Fourth Example Application]

FIG. 32 is a block diagram showing an example of a schematicconfiguration of an image capturing device adopting the embodimentdescribed above. An image capturing device 960 captures an image of asubject, generates an image, encodes the image data, and records theimage data in a recording medium.

The image capturing device 960 includes an optical block 961, an imagecapturing section 962, a signal processing section 963, an imageprocessing section 964, a display section 965, an external interface966, a memory 967, a media drive 968, an OSD 969, a control section 970,a user interface 971, and a bus 972.

The optical block 961 is connected to the image capturing section 962.The image capturing section 962 is connected to the signal processingsection 963. The display section 965 is connected to the imageprocessing section 964. The user interface 971 is connected to thecontrol section 970. The bus 972 interconnects the image processingsection 964, the external interface 966, the memory 967, the media drive968, the OSD 969, and the control section 970.

The optical block 961 includes a focus lens, an aperture stop mechanism,and the like. The optical block 961 forms an optical image of a subjecton an image capturing surface of the image capturing section 962. Theimage capturing section 962 includes an image sensor such as a CCD, aCMOS or the like, and converts by photoelectric conversion the opticalimage formed on the image capturing surface into an image signal whichis an electrical signal. Then, the image capturing section 962 outputsthe image signal to the signal processing section 963.

The signal processing section 963 performs various camera signalprocesses, such as knee correction, gamma correction, color correctionand the like, on the image signal input from the image capturing section962. The signal processing section 963 outputs the image data after thecamera signal process to the image processing section 964.

The image processing section 964 encodes the image data input from thesignal processing section 963, and generates encoded data. Then, theimage processing section 964 outputs the generated encoded data to theexternal interface 966 or the media drive 968. Also, the imageprocessing section 964 decodes encoded data input from the externalinterface 966 or the media drive 968, and generates image data. Then,the image processing section 964 outputs the generated image data to thedisplay section 965. Also, the image processing section 964 may outputthe image data input from the signal processing section 963 to thedisplay section 965, and cause the image to be displayed. Furthermore,the image processing section 964 may superimpose data for displayacquired from the OSD 969 on an image to be output to the displaysection 965.

The OSD 969 generates an image of a GUI, such as a menu, a button, acursor or the like, for example, and outputs the generated image to theimage processing section 964.

The external interface 966 is configured as an USB input/outputterminal, for example. The external interface 966 connects the imagecapturing device 960 and a printer at the time of printing an image, forexample. Also, a drive is connected to the external interface 966 asnecessary. A removable medium, such as a magnetic disk, an optical discor the like, for example, is mounted on the drive, and a program readfrom the removable medium may be installed in the image capturing device960. Furthermore, the external interface 966 may be configured as anetwork interface to be connected to a network such as a LAN, theInternet or the like. That is, the external interface 966 serves astransmission means of the image capturing device 960.

A recording medium to be mounted on the media drive 968 may be anarbitrary readable and writable removable medium, such as a magneticdisk, a magneto-optical disk, an optical disc, a semiconductor memory orthe like, for example. Also, a recording medium may be fixedly mountedon the media drive 968, configuring a non-transportable storage sectionsuch as a built-in hard disk drive or an SSD (Solid State Drive), forexample.

The control section 970 includes a processor such as a CPU, and a memorysuch as an RAM or an ROM. The memory stores a program to be executed bythe CPU, program data, and the like. A program stored in the memory isread and executed by the CPU at the time of activation of the imagecapturing device 960, for example. The CPU controls the operation of theimage capturing device 960 according to an operation signal input fromthe user interface 971, for example, by executing the program.

The user interface 971 is connected to the control section 970. The userinterface 971 includes a button, a switch and the like used by a user tooperate the image capturing device 960, for example. The user interface971 detects an operation of a user via these structural elements,generates an operation signal, and outputs the generated operationsignal to the control section 970.

In the image capturing device 960 configured in this manner, the imageprocessing section 964 has a function of the image encoding device 10and the image decoding device 60 according to the embodiment describedabove. Accordingly, an increase in processing cost accompanying theextension of block size can be curbed even when the LM mode is adoptedfor encoding and decoding images of the image capturing device 960.

<7. Summary>

Heretofore, the image encoding device 10 and the image decoding device60 according to an embodiment have been described using FIGS. 1 to 32.According to the present embodiment, when the LM mode using a functionof the value of the corresponding luminance component is adopted forintra prediction of the color difference component for encoding ordecoding images, the ratio of the number of reference pixels referencedto calculate coefficients of the function to the block size is variablycontrolled. Therefore, an increase in processing cost can be avoided ormitigated by curbing an increase of the number of reference pixelsaccompanying the extension of the block size.

Also according to the present embodiment, the ratio is controlled sothat the number of reference pixels is constant when the block sizeexceeds a predetermined size. According to such a configuration,coefficients of the function can be calculated using a common circuit orlogic for a plurality of block sizes. Therefore, an increase in scale ofthe circuit or logic caused by the adoption of the LM mode can also becurbed.

Also according to the present embodiment, reference pixels are notexcessively reduced when the block size falls below a predeterminedsize. Therefore, the degradation of prediction accuracy in LM mode dueto an insufficient number of reference pixels can be prevented. Arelatively large block size can normally be set when an image in theblock is monotonous and a prediction can easily be made. Therefore, whenthe block size is still larger, the risk of extreme degradation ofprediction accuracy caused by the reduction of more reference pixels issmall.

Also according to the present embodiment, the ratio can separately becontrolled in the vertical direction and the horizontal direction of theblock. According to such a configuration, coefficients of the functioncan be calculated using a common circuit or logic without beingdependent on the chroma-format. In addition, it becomes possible toleave more reference pixels arranged along the horizontal direction thatcan be accessed with less amount of memory access and to reduce morereference pixels arranged along the vertical direction. Further, whenthe short distance intra prediction method is used, reference pixels tobe reduced can adaptively be changed in accordance with the shape of theblock.

According to the two modifications described above, the amount ofconsumption of memory resources in connection with the introduction ofthe LM mode can effectively be reduced.

Additionally, in the present specification, an example has been mainlydescribed where the information about intra prediction and theinformation about inter prediction is multiplexed to the header of theencoded stream, and the encoded stream is transmitted from the encodingside to the decoding side. However, the method of transmitting thisinformation is not limited to such an example. For example, thisinformation may be transmitted or recorded as individual data that isassociated with an encoded bit stream, without being multiplexed to theencoded bit stream. The term “associate” here means to enable an imageincluded in a bit stream (or a part of an image, such as a slice or ablock) and information corresponding to the image to link to each otherat the time of decoding. That is, this information may be transmitted ona different transmission line from the image (or the bit stream). Or,this information may be recorded on a different recording medium (or ina different recording area on the same recording medium) from the image(or the bit stream). Furthermore, this information and the image (or thebit stream) may be associated with each other on the basis of arbitraryunits such as a plurality of frames, one frame, a part of a frame or thelike, for example.

Heretofore, a preferred embodiment of the present disclosure has beendescribed in detail while referring to the appended drawings, but thetechnical scope of the present disclosure is not limited to such anexample. It is apparent that a person having an ordinary skill in theart of the technology of the present disclosure may make variousalterations or modifications within the scope of the technical ideasdescribed in the claims, and these are, of course, understood to bewithin the technical scope of the present disclosure.

Additionally, the present technology may also be configured as below.

-   (1)

An image processing apparatus including:

a prediction section that generates a predicted value of a colordifference component of a pixel of an image to be decoded by using afunction of a value of a corresponding luminance component;

a coefficient calculation section that calculates a coefficient of thefunction used by the prediction section by referencing a pixel around ablock to which the pixel belongs; and

a controller that controls a ratio of a number of reference pixels usedby the coefficient calculation section to a block size of the block.

-   (2)

The image processing apparatus according to (1), wherein the controllercontrols the ratio in accordance with the block size.

-   (3)

The image processing apparatus according to (2), wherein the controllerexercises control in a manner that the ratio when the block size is afirst size becomes smaller than the ratio when the block size is asecond size, which is smaller than the first size.

-   (4)

The image processing apparatus according to (3), wherein the controllercontrols the ratio in a manner that the number of reference pixelsbecomes constant when the block size exceeds a predetermined size.

-   (5)

The image processing apparatus according to (4), wherein the coefficientcalculation section calculates the coefficient for a plurality of theblock sizes exceeding the predetermined size using a common circuit orlogic.

-   (6)

The image processing apparatus according to any one of (1) to (5),wherein the controller controls the ratio in accordance with mappingdefined in advance between the block size and the ratio.

-   (7)

The image processing apparatus according to any one of (1) to (6),wherein the controller controls the ratio by changing the number ofreference pixels thinned out upon calculating the coefficient.

-   (8)

The image processing apparatus according to (7), wherein the controllersets the number of reference pixels to be thinned out to zero when theblock size falls below a predetermined size.

-   (9)

The image processing apparatus according to (1), wherein the controllerseparately controls a first ratio that is a ratio of a number of leftreference pixels of the block to a size of the block in a verticaldirection and a second ratio that is a ratio of a number of upperreference pixels of the block to a size of the block in a horizontaldirection.

-   (10)

The image processing apparatus according to (9), wherein the controllercontrols the first ratio or the second ratio in a manner that the firstratio becomes equal to or less than the second ratio with respect to anidentical block size.

-   (11)

The image processing apparatus according to (9), wherein when a shortdistance intra prediction method is used, the controller controls only aratio corresponding to a direction to which one of the first ratio andthe second ratio that is larger in size corresponds.

-   (12)

The image processing apparatus according to (9), wherein when achroma-format representing a resolution of the color differencecomponent is 4:2:2, the controller controls the first ratio in a mannerthat the number of the left reference pixels of the block becomes equalto the number of the upper reference pixels of the block.

-   (13)

The image processing apparatus according to (1), wherein the controllercontrols the ratio in accordance with a chroma-format representing aresolution of the color difference component.

-   (14)

The image processing apparatus according to (13), wherein the controllerexercises control in a manner that the ratio when the chroma-formatrepresents a first resolution becomes smaller than the ratio when thechroma-format represents a second resolution, which is lower than thefirst resolution.

-   (15)

The image processing apparatus according to (5), wherein when a bitdepth of a pixel value exceeds a predetermined number of bits, thecoefficient calculation section calculates the coefficient using thepixel values of the reference pixels reduced to the predetermined numberof bits.

-   (16)

An image processing method including:

generating a predicted value of a color difference component of a pixelof an image to be decoded by using a function of a value of acorresponding luminance component;

calculating a coefficient of the function by referencing a pixel arounda block to which the pixel belongs; and

controlling a ratio of a number of reference pixels used for calculatingthe coefficient to a block size of the block.

-   (17)

An image processing apparatus including:

a prediction section that generates a predicted value of a colordifference component of a pixel of an image to be encoded by using afunction of a value of a corresponding luminance component;

a coefficient calculation section that calculates a coefficient of thefunction used by the prediction section by referencing a pixel around ablock to which the pixel belongs; and

a controller that controls a ratio of a number of reference pixels usedby the coefficient calculation section to a block size of the block.

-   (18)

An image processing method including:

generating a predicted value of a color difference component of a pixelof an image to be encoded by using a function of a value of acorresponding luminance component;

calculating a coefficient of the function by referencing a pixel arounda block to which the pixel belongs; and

controlling a ratio of a number of reference pixels used for calculatingthe coefficient to a block size of the block.

-   (19)

An image processing apparatus including:

a prediction section that makes an intra prediction of a colordifference component of an image using a luminance component of theimage to be decoded; and

a controller that variably controls a reference pixel referenced whenthe intra prediction is made by the prediction section.

-   (20)

An image processing method including:

making an intra prediction of a color difference component of an imageusing a luminance component of the image to be decoded; and

variably controlling a reference pixel referenced when the intraprediction of the color difference component is made.

REFERENCE SIGNS LIST

-   10 image encoding device (image processing apparatus)-   42 prediction controller-   44 coefficient calculation section (thinning section)-   46 prediction section-   60 image decoding device (image processing apparatus)-   92 prediction controller-   94 coefficient calculation section (thinning section)-   96 prediction section

The invention claimed is:
 1. An image processing apparatus comprising: aprediction section that generates a predicted value of a colordifference component of a pixel of an image to be decoded by using afunction of a value of a corresponding luminance component; acoefficient calculation section that calculates a coefficient of thefunction used by the prediction section by referencing a pixel around ablock to which the pixel belongs; and a controller that controls a ratioof a number of reference pixels used by the coefficient calculationsection to a block size of the block, wherein the prediction section,the coefficient calculation section, and the controller are eachimplemented via at least one processor.
 2. The image processingapparatus according to claim 1, wherein the controller controls theratio in accordance with the block size.
 3. The image processingapparatus according to claim 2, wherein the controller exercises controlin a manner that the ratio when the block size is a first size becomessmaller than the ratio when the block size is a second size, which issmaller than the first size.
 4. The image processing apparatus accordingto claim 3, wherein the controller controls the ratio in a manner thatthe number of reference pixels becomes constant when the block sizeexceeds a predetermined size.
 5. The image processing apparatusaccording to claim 4, wherein the coefficient calculation sectioncalculates the coefficient for a plurality of the block sizes exceedingthe predetermined size using a common circuit or logic.
 6. The imageprocessing apparatus according to claim 5, wherein when a bit depth of apixel value exceeds a predetermined number of bits, the coefficientcalculation section calculates the coefficient using the pixel values ofthe reference pixels reduced to the predetermined number of bits.
 7. Theimage processing apparatus according to claim 1, wherein the controllercontrols the ratio in accordance with mapping defined in advance betweenthe block size and the ratio.
 8. The image processing apparatusaccording to claim 1, wherein the controller controls the ratio bychanging the number of reference pixels thinned out upon calculating thecoefficient.
 9. The image processing apparatus according to claim 8,wherein the controller sets the number of reference pixels to be thinnedout to zero when the block size falls below a predetermined size. 10.The image processing apparatus according to claim 1, wherein thecontroller separately controls a first ratio that is a ratio of a numberof left reference pixels of the block to a size of the block in avertical direction and a second ratio that is a ratio of a number ofupper reference pixels of the block to a size of the block in ahorizontal direction.
 11. The image processing apparatus according toclaim 10, wherein the controller controls the first ratio or the secondratio in a manner that the first ratio becomes equal to or less than thesecond ratio with respect to an identical block size.
 12. The imageprocessing apparatus according to claim 10, wherein when a shortdistance intra prediction method is used, the controller controls only aratio corresponding to a direction to which one of the first ratio andthe second ratio that is larger in size corresponds.
 13. The imageprocessing apparatus according to claim 10, wherein when a chroma-formatrepresenting a resolution of the color difference component is 4:2:2,the controller controls the first ratio in a manner that the number ofthe left reference pixels of the block becomes equal to the number ofthe upper reference pixels of the block.
 14. The image processingapparatus according to claim 1, wherein the controller controls theratio in accordance with a chroma-format representing a resolution ofthe color difference component.
 15. The image processing apparatusaccording to claim 14, wherein the controller exercises control in amanner that the ratio when the chroma-format represents a firstresolution becomes smaller than the ratio when the chroma-formatrepresents a second resolution, which is lower than the firstresolution.
 16. An image processing method comprising: generating apredicted value of a color difference component of a pixel of an imageto be decoded by using a function of a value of a correspondingluminance component; calculating a coefficient of the function byreferencing a pixel around a block to which the pixel belongs; andcontrolling a ratio of a number of reference pixels used for calculatingthe coefficient to a block size of the block.
 17. An image processingapparatus comprising: a prediction section that generates a predictedvalue of a color difference component of a pixel of an image to beencoded by using a function of a value of a corresponding luminancecomponent; a coefficient calculation section that calculates acoefficient of the function used by the prediction section byreferencing a pixel around a block to which the pixel belongs; and acontroller that controls a ratio of a number of reference pixels used bythe coefficient calculation section to a block size of the block,wherein the prediction section, the coefficient calculation section, andthe controller are each implemented via at least one processor.
 18. Animage processing method comprising: generating a predicted value of acolor difference component of a pixel of an image to be encoded by usinga function of a value of a corresponding luminance component;calculating a coefficient of the function by referencing a pixel arounda block to which the pixel belongs; and controlling a ratio of a numberof reference pixels used for calculating the coefficient to a block sizeof the block.
 19. A non-transitory computer-readable medium havingembodied thereon a program, which when executed by a computer causes thecomputer to execute an image processing method, the method comprising:generating a predicted value of a color difference component of a pixelof an image to be decoded by using a function of a value of acorresponding luminance component; calculating a coefficient of thefunction by referencing a pixel around a block to which the pixelbelongs; and controlling a ratio of a number of reference pixels usedfor calculating the coefficient to a block size of the block.
 20. Anon-transitory computer-readable medium having embodied thereon aprogram, which when executed by a computer causes the computer toexecute an image processing method, the method comprising: generating apredicted value of a color difference component of a pixel of an imageto be encoded by using a function of a value of a correspondingluminance component; calculating a coefficient of the function byreferencing a pixel around a block to which the pixel belongs; andcontrolling a ratio of a number of reference pixels used for calculatingthe coefficient to a block size of the block.